Forum Moderators: phranque

Message Too Old, No Replies

Redirect 301 with similarily names url's

Redirect 301 infinite loop problem

         

audiopleb

10:06 am on Oct 29, 2008 (gmt 0)

10+ Year Member



I'm trying to do a Redirect 301 and it's all going a bit wrong!

I've got this:

Redirect 301 /digital-marketing/ http://www.mydomain.com/digital-marketing/digital-marketing.html


But when i test it i get:


Redirect Loop

Redirection limit for this URL exceeded. Unable to load the requested page.
And this in the url:

http://www.mydomain.com/digital-marketing/digital-marketing.htmldigital-marketing.htmldigital-marketing.htmldigital-marketing.htmldigital-marketing.htmldigital-marketing.htmldigital-marketing.htmldigital-marketing.htmldigital-marketing.htmldigital-marketing.htmldigital-marketing.htmldigital-marketing.htmldigital-marketing.htmldigital-marketing.htmldigital-marketing.htmldigital-marketing.htmldigital-marketing.htmldigital-marketing.htmldigital-marketing.htmldigital-marketing.htmldigital-marketing.html


I presume that as the digital-marketing is in both urls it is getting confused on the match. Could anyone please advise me as to how i can do this properly, i'm going bananas trying to work it out!

g1smd

11:22 am on Oct 29, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There's nothing to stop the loop.

You could use RedirectMatch and end the tested URL pattern with $ to stop it right there.

Personally, I would use RewriteRule in a similar way -- because you can't have expressions using RewriteRule as well as Redirect/Redirectmatch in the same .htacess without there being a problem with knowing the order they will be evaluated -- and I use RewriteRule a lot.

audiopleb

11:31 am on Oct 29, 2008 (gmt 0)

10+ Year Member



Ah okay great. Thank you!