[TYPO3] Need help on .htaccess/realURL

Andreas Koppa akoppa at gmail.com
Thu Mar 2 21:49:20 CET 2006


Hi Michael,

I´m a bit late.  Just tested your suggestions and wish to thank you for so 
comprehensive explanation.  It works as you said.
  
What I liked much is: RewriteRule (\.html|/)$ index.php [L]
instead of: RewriteRule .* index.php [L]
Now all 404 errors accross my site popup the corresponding error page.

Tim, 
Thanks for the input too.  I wish to point out that at least in my site the 
above rewrite rule works as explained, otherwise ErrorDocument is ignored 
and all errors accross my site trigger the Typo3 error script.

Andreas



MC> # image protection
MC> RewriteEngine on
MC> RewriteCond %{HTTP_REFERER} !^http://domain.com/.*$      [NC]
MC> RewriteCond %{HTTP_REFERER} !^http://domain.com$      [NC]
MC> RewriteCond %{HTTP_REFERER} !^http://subdom1.domain.com/.*$
MC> [NC]
MC> RewriteCond %{HTTP_REFERER} !^http://subdom1.domain.com$      [NC]
MC> RewriteCond %{HTTP_REFERER} !^http://subdom2.domain.com/.*$
MC> [NC]
MC> RewriteCond %{HTTP_REFERER} !^http://subdom2.domain.com$      [NC]
MC> RewriteCond %{HTTP_REFERER} !^http://www.domain.com/.*$      [NC]
MC> RewriteCond %{HTTP_REFERER} !^http://www.domain.com$      [NC]
MC> RewriteCond %{HTTP_REFERER} !^http://www.subdom1.domain.com/.*$
MC> [NC]
MC> RewriteCond %{HTTP_REFERER} !^http://www.subdom1.domain.com$
MC> [NC]
MC> RewriteCond %{HTTP_REFERER} !^http://www.subdom2.domain.com/.*$
MC> [NC]
MC> RewriteCond %{HTTP_REFERER} !^http://www.subdom2.domain.com$
MC> [NC]
MC> RewriteRule .*\.(jpg|gif|bmp)$ http://www.domain.com/gif/stolen.jpeg
MC> [R,NC]
MC> # You will have to change this path if your TYPO3 installation is
MC> located
MC> # in a subdirectory of the website root.
MC> # RewriteBase /mytypo3dir/
MC> RewriteBase /
MC> # typo3 rewrites
MC> RewriteRule
MC> ^(typo3|typo3temp|typo3conf|t3lib|tslib|fileadmin|uploads|
MC> showpic\.php)/ - [L]
MC> RewriteRule ^typo3$ typo3/index_re.php [L]
MC> RewriteCond %{REQUEST_FILENAME} !-f
MC> RewriteCond %{REQUEST_FILENAME} !-d
MC> RewriteCond %{REQUEST_FILENAME} !-l
MC> RewriteRule .* index.php [L]
MC> -----
MC> If you want to allow some directories, say cgi scripts in an admin
MC> directory, without Typo3 processing, add the following before the
MC> Typo3 RewriteConds.
MC> 
MC> RewriteRule ^admin$ - [L]
MC> RewriteRule ^admin/.*$ - [L]
MC> If you want to only let .html and / requests get passed to Typo3,
MC> replace the Typo3 [L] line with the following. This is handy when
MC> you  have blah.htm or blah.php files that shouldn't be processed by
MC> Typo3  in your system.
MC> 
MC> RewriteRule (\.html|/)$ index.php [L]
MC> 
MC> Lastly, if you want a simple redirect to a particular page on an
MC> error besides using Typo3's own 404 architecture, add the following
MC> at the end of .htaccess.
MC> 
MC> ErrorDocument 404 /





More information about the TYPO3-english mailing list