I used this htaccess example to redirect all the users who visit my website to the old directory except me. So I can build the new website en test it without being redirected.
1 2 3 4 5 |
Options +FollowSymlinks RewriteEngine On RewriteCond %{REMOTE_ADDR} !=12.34.56.78 RewriteCond %{HTTP_HOST} ^(www.)?pietervanos.net$ RewriteRule ^(/)?$ old [L] |
Now when you guys visit www.pietervanos.net you will be redirected to www.pietervanos.net/old
But when I visit it, I will still be able to visit www.pietervanos.net/ where the new website is being build.
Change the end of the following line to your ip address:
RewriteCond %{REMOTE_ADDR} !=12.34.56.78
Leave a Reply