g1smd

msg:4450766 | 11:13 am on May 8, 2012 (gmt 0) |
It's two (perhaps three) lines of code, using a RewriteCond (or two) and a RewriteRule. What have you tried so far?
|
geoffb

msg:4450775 | 11:41 am on May 8, 2012 (gmt 0) |
Hi g1smd I have tried: RewriteEngine on RewriteCond $1 !^http://www.mysite.com/development RewriteCond %{REMOTE_HOST} !^00\.00\.00\.00 RewriteRule (.*) http://www.example.com/$1 [R=301,L] [edited by: incrediBILL at 12:35 pm (utc) on May 8, 2012] [edit reason] fixed URL w/example.com [/edit]
|
g1smd

msg:4450781 | 12:11 pm on May 8, 2012 (gmt 0) |
$1 will never contain protocol or hostname nor slash after hostname. Use example.com in code snippets in this forum. I thought you wanted to redirect to a specific page? Your code doesn't do that. You should check (with a RewriteCond) that the user is not requesting the redirected-to page otherwise (.*) will match again and create an infinite redirect loop. You should serve "503 Unavailable" to Google and others until you're ready to go.
|
geoffb

msg:4450784 | 12:27 pm on May 8, 2012 (gmt 0) |
Hi, So would this not work: RewriteEngine on RewriteCond $1 !^development RewriteCond %{REMOTE_HOST} !^00\.00\.00\.00 RewriteRule (.*) http://www.example.com/index.html/$1 [R=301,L] Thanks
|
g1smd

msg:4450789 | 12:50 pm on May 8, 2012 (gmt 0) |
Use the Live HTTP Headers extension for Firefox to test it. You'll likely see an infinite loop with the target URL getting longer and longer. This is also one of those rare cases where a 302 redirect might be in order.
|
geoffb

msg:4450795 | 1:01 pm on May 8, 2012 (gmt 0) |
Hi g1smd, Thanks, I sorted it with a 302 redirect like you said. I only want it as nearing completion i clicked on a link I built in the footer and went to the client site, this development domain link will now show on the clients Google Analytics so i just wanted to send anything back than the website for them if they see my link and go to have a look. Now only my IP serves up the site while I finish off. thanks for the tip. geoffb
|
g1smd

msg:4450823 | 2:02 pm on May 8, 2012 (gmt 0) |
What do other users see? Have you tested it to be sure?
|
|