mndasher
06-21-2009, 05:40 AM
In my .htaccess file I have several rewrites going on. I tried adding a new one today, and got an odd error.
"Firefox has detected that the server is redirecting the request for this address in a way that will never complete."
The new rewrite rule looks like this.
RewriteRule ^([A-Za-z]+)/([0-9]+)/([A-Za-z0-9-]+)\.html$ /index.php?article=$2&title=$3 [L,nc]
The input url should look like
http://www.mywebsite.com/article/5/some-title.html
and redirect to
http://www.mywebsite.com/index.php?article=5&title=some-title
I tried having the first part of the rewrite rule be explicitly ^(article)/ but that didn't work either. The /article/ just means it is an article I want and is other wise a throw away. I have also tried having the $2 and $3 be $1 and $2 but that didn't work either.
The other rewrites are this;
RewriteRule ^(.*)$ http://www.mywebsite.com/$1 [R=301,nc]
RewriteRule ^([0-9]+)/([a-zA-Z0-9-]+)\.html$ /index.php?id=$1&title=$2 [L,nc]
RewriteRule ^([0-9]+)/([0-9]+)/([A-Za-z0-9-]+)\.html$ /index.php?id=$1&mo=$2&title=$3 [L,nc]
RewriteRule ^([0-9]+)/([0-9]+)/([0-9]+)/([A-Za-z0-9-]+)\.html$ /index.php?id=$1&mo=$2&exp=$3&title=$4 [L,nc]
Without the new rewrite these all function correctly.
"Firefox has detected that the server is redirecting the request for this address in a way that will never complete."
The new rewrite rule looks like this.
RewriteRule ^([A-Za-z]+)/([0-9]+)/([A-Za-z0-9-]+)\.html$ /index.php?article=$2&title=$3 [L,nc]
The input url should look like
http://www.mywebsite.com/article/5/some-title.html
and redirect to
http://www.mywebsite.com/index.php?article=5&title=some-title
I tried having the first part of the rewrite rule be explicitly ^(article)/ but that didn't work either. The /article/ just means it is an article I want and is other wise a throw away. I have also tried having the $2 and $3 be $1 and $2 but that didn't work either.
The other rewrites are this;
RewriteRule ^(.*)$ http://www.mywebsite.com/$1 [R=301,nc]
RewriteRule ^([0-9]+)/([a-zA-Z0-9-]+)\.html$ /index.php?id=$1&title=$2 [L,nc]
RewriteRule ^([0-9]+)/([0-9]+)/([A-Za-z0-9-]+)\.html$ /index.php?id=$1&mo=$2&title=$3 [L,nc]
RewriteRule ^([0-9]+)/([0-9]+)/([0-9]+)/([A-Za-z0-9-]+)\.html$ /index.php?id=$1&mo=$2&exp=$3&title=$4 [L,nc]
Without the new rewrite these all function correctly.