Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account

Mod_rewrite causing too many redirects

0

41 views

The .htaccess we have in our document_root directory is as follows:

RewriteEngine on

RewriteRule ^posts/1/first-post-title$ /posts/1.html [L]
RewriteCond %{REQUEST_URI} ^/posts/1
RewriteCond %{REQUEST_URI} !/^posts/1/first-post-title$
RewriteRule (.*) posts/1/first-post-title [R=301,L]

With just the first RewriteRule line, the server correctly redirects. When the other three lines are included and we navigate to "http://localhost/posts/1/first-post-title", Safari is giving an error of:

Too many redirects occurred trying to open "http://localhost/posts/1/first-post-title". This might occur if you open a page that is redirected to open another page which then is redirected to open the original page.

asked May 7, 2011 6:45 am CDT
posted via ServerFault

0 Answers

Be the first to answer this question

Join with account you already have


Sign in with Twitter account
Sign in with Facebook account
Sign in with Google Friend Connect

Preview
Similar questions
Redirects with .htaccess.
February 23, 2011
.htaccess Redirects
January 31, 2011
Session Redirects
January 20, 2011