Mobile app version of vmapp.org
Login or Join
Hamaas447

: Redirect all traffic to construction page except my IP in .htaccess The title pretty much says it all. I want to direct all traffic to an under construction page except for traffic originating

@Hamaas447

Posted in: #Apache #Htaccess

The title pretty much says it all.

I want to direct all traffic to an under construction page except for traffic originating from my IP address so I can move a large development site into production and tweak a few things along the way.

Any way to do this in .htaccess?

Thanks.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Hamaas447

2 Comments

Sorted by latest first Latest Oldest Best

 

@Goswami781

in .htaccess, i am nt sure bt with php u can do this...
Create index.php using following code

<?php
header ("Location:./under-construction/");
?>


keep this index.php file in public_html folder and your users will directly redirected to under construction page and u can check ur work directly entering ur page for exampale: xyz.com/demo/ or if your real page file(index.php) and should be located in same folder public_html than rename ur real page name frm index.php to demo.html for a while...

10% popularity Vote Up Vote Down


 

@Kevin317

RewriteCond %{REMOTE_ADDR} != 192.168.1.0 #your ip goes here
RewriteRule !^maintanence$ maintanence [L]

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme