[TYPO3-dev] Problem with mod_rewrite

Lukas Stancik lukas.stancik at robe.cz
Sat Sep 6 15:52:21 CEST 2008


Hi,

I had exactly the same problem. After having a look into the mod_rewrite documentation I 
found out that the RewriteRule in your code below works probably only for directories 
(note the trailing slash at the end of line) but not for the files. I think that it 
instructs the engine to stop rewriting for directory /favicon.ico/ which obviously doesn't 
make much sense unless you have such directory :)

I have modified my .htaccess file like this:

---snip---
# Stop rewrite processing inside following directories
RewriteRule ^(typo3|t3lib|tslib|fileadmin|typo3conf|typo3temp|uploads)/ - [L]
# Stop rewrite processing if following files are requested in root of website
RewriteRule ^(favicon\.ico|robots\.txt|showpic\.php) - [L]
---snip---

I am not able to say if this is safe, correct or anything but it works :)

Still I could not figure out why is .htaccess referring to showpic.php file since it is 
located deep in typo3/ directory, maybe it's location changed during development of TYPO3???

PS: I'm sorry if this is a wrong list to post but I'd like to save some time to others 
that will hit this issue in future. Thanks for understanding.

Best Regards

Lukas Stancik


Steffen Ritter wrote:
> Hello,
> I have Problems with mod_rewrite, which I do not understand.
> I'm using standard .htaccess from T3 but calling domain/robots.txt or 
> /favicon.ico oder something else which is a file in root directory will 
> be ignored, the homepage of my website ist displayed.
> Simulate static documents is activated (and working as aspected).
> I also tried, to switch pagenotfoundhandling on. Nothing happenend.
> 
> I'm Using apache2 with php 5.2.6 as fast-cgi.
> 
> .htaccess (for reminder)
> 
> AddHandler php-fastcgi .php
> ### Begin: Rewrite stuff ###
> 
> # Enable URL rewriting
> RewriteEngine On
> RewriteBase /
> RewriteRule 
> ^(typo3|t3lib|tslib|fileadmin|typo3conf|typo3temp|uploads|showpic\.php|favicon\.ico)/ 
> - [L]
> 
> RewriteRule ^typo3$ typo3/index_re.php [L]
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteCond %{REQUEST_FILENAME} !-l
> 
> RewriteRule .* index.php [L]
> 
> ### End: Rewrite stuff ###
> 
> 
> kind regards
> 
> Steffen




More information about the TYPO3-dev mailing list