httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob <bobsie...@googlemail.com>
Subject Re: [users@httpd] Help with mod_rewrite
Date Sun, 11 Feb 2007 22:40:54 GMT
Frank Arensmeier wrote:
> The problem is when a user requests a URL like:
> 
> http://myserver.com/en/about
> 
> Apparently, Apache does an internal redirect because it is looking for 
> the index.php file (which exists) in the folder "about". The thing I do 
> not understand is why the user is being redirected to 
> http://myserver.com/about???

I think there's an external redirect to /about/ (notice the trailing 
slash). This is normal procedure done by mod_dir. Use a RewriteRule, 
which fixes the trailing slash problem.

RewriteCond %{REQUEST_URI} !/$
RewriteRule !\.[a-z]{2,4}$ %{REQUEST_URI}/ [R=301,L]
RewriteRule ^(se|en|us)/(.+) /$2 [E=LANG_CODE:$1]

-- 
Bob

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message