httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reese <howel...@inkworkswell.com>
Subject Re: [users@httpd] Mod_Rewrite voodoo
Date Sat, 09 Jan 2010 17:54:44 GMT
I said I would test this,

>  RewriteEngine On
>  RewriteCond %{HTTP_HOST} subdomain\.domain\.ext
>  RewriteRule (.*)(0[5-6]).html$ /20$2/$1$2.html [R=301,L]

Testing had mixed results.

When this rule was at subdomain.domain.ext/sandbox/.htaccess
and the submitted url was

http://subdomain.domain.ext/sandbox/fileDDMMYY.ext

it redirected to http://subdomain.domain.ext/2005/fileDDMMYY.ext
which was the desired and I thought, the expected behavior.

However, when the rule was placed at subdomain.domain.ext/.htaccess
it did not work - it created an endless loop with multiple
insertions of the /2005/ string. For users attempting to reach

http://subdomain.domain.ext/fileDDMMYY.ext

the desired rewrite or redirect URL is

http://subdomain.domain.ext/2005/fileDDMMYY.ext

but this is what happened:

http://subdomain.domain.ext/2005/2005/2005/2005/2005/2005/2005/2005/2005/2005/2005/2005/2005/2005/2005/2005/2005/2005/2005/2005/fileDDMMYY.ext

What is really malfunctioning here? Can this rewrite rule be
corrected?

Reese


---------------------------------------------------------------------
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