Forum Moderators: phranque

Message Too Old, No Replies

Redirect Temporary Folder

         

boxfan

12:42 am on May 13, 2008 (gmt 0)

10+ Year Member



Hello,

I am trying to redirect all links from visitors other then myself to a temporary directory by using the following code but I keep getting an endless loop message from my browser.

RewriteCond %{REMOTE_ADDR} !^12\.345\.67\.89$
RewriteCond %{REQUEST_URI} !^/temp$
RewriteRule ^(.*)$ [mydomain.com...] [L]

Thanks for any help.

jdMorgan

3:04 am on May 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Take the end-anchor off the RewriteCond pattern: "!^/temp$" should be "!^/temp/"

Also, consider whether you really want a 302 temporary redirect, or whether an internal rewrite would suffice.

Jim

[edited by: jdMorgan at 3:04 am (utc) on May 13, 2008]

boxfan

1:57 pm on May 13, 2008 (gmt 0)

10+ Year Member



Oh, I see. Thank you. Works perfectly now.