Forum Moderators: phranque
I'm needing some help if possible in doing a .htaccess rewrite rule. I've not got a clue where to start or whether its even possible.
I've currently got vb advanced cmps installed in my domain root and vbulleting in a sub folder called /forum/
I'm wanting to remove cmps from the domain root and and set up a new cms system. Its going to take me a few days to do all this.
Is it possible to set up a rewrite rule so that I can from my IP address access the domain as normal but if anyone else tries to access a url in the root of the domain that are automatically forwarded to the forum sub directory. This would give me chance to change eveything over without having any downtime on my site.
Hope someone can help me with this or point me in the direction of where I can work our how to do it myself.
code:
<?php
if ($_SERVER['REMOTE_ADDR']!='##.##.##.##'){
header ('Location: [yoursub.domain.com');...]
}
?>
Action when conditions are met:
Redirect root requests to corresponding forum-subdirectory path.
---
With mod_rewrite:
RewriteCond %{REMOTE_ADDR} !=192.168.0.1
RewriteRule ^([^/]*)$ http://www.example.com/forum-subdirectory/$1 [R=301,L]
Jim