Rewrite loop

New to mod_rewrite? This is a good place to start.

Rewrite loop

Postby lostdog » Fri Oct 09, 2009 9:38 am

The following to rewrites will not work together. I thnk it has created a loop. Please help.

RewriteRule widgets.php http://www.myurl.html [R=301,L,NE]
RewriteRule widgets.htm http://www.myurl.html [R=301,L,NE]
lostdog
 
Posts: 6
Joined: Tue Apr 22, 2008 5:04 pm

Postby richardk » Fri Oct 09, 2009 12:49 pm

I don't see any reason why they wouldn't work together, unless you a redirecting to a URL that also matches the rule (maybe widgets.html??). If you were, you would need $ (matching the end of the URL) so that it doesn't match .html.
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^widgets\.(htm|php)$ http://www.example.com/widgets.html [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 12 guests

cron