Forum Moderators: phranque

Message Too Old, No Replies

301 redirect question

         

hannamyluv

2:38 pm on Jul 13, 2004 (gmt 0)

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



I am trying to do a 301 redirect from www.exampleafg.com to www.exampleafg.com/cgi-bin/main.html. We currently use a meta redirect in combination with a javascript but recently, it stopped passing on the PR.

I've tried

redirect 301 / [exampleafg.com...]

and

redirect 301 /index.htm [exampleafg.com...]

Neither of those work so, what am missing here? How do I construct this?

jdMorgan

2:47 pm on Jul 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You're probably getting a redirection loop... What do you *see* when "it doesn't work"?

"Redirect 301 /" will redirect *anything* that starts with a slash, so it will also redirect the redirected request -- thus a loop.

The usual solution would be to use mod_rewrite to do the redirect conditionally, thus avoiding the loop. You also might be able to use RedirectMatch. They key is to avoid redirecting the redirected request, so the URLs must be sufficiently unique (as defined by the pattern-matching capabilities of the directives you're using) to avoid recursion.

Jim