开发者

htaccess redirect: [everyone] [every page] -> [holding page] - except me?

开发者 https://www.devze.com 2023-01-17 11:00 出处:网络
I\'m about to launch the latest version of my webapp and would like to ensure all visitors are redirected to a holding page while i make开发者_开发技巧 the transition.

I'm about to launch the latest version of my webapp and would like to ensure all visitors are redirected to a holding page while i make开发者_开发技巧 the transition.

So i need an htaccess redirect that excludes my ip somehow?


You could check the remove address:

RewriteCond %{REMOTE_ADDR} !=12.345.67.89
RewriteRule !^maintanence$ maintanence [L]

You also might want to exclude other files like images, stylesheets, etc.:

RewriteCond %{REMOTE_ADDR} !=12.345.67.89
RewriteRule !^(maintanence$|images/|style/) maintanence [L]

This will rewrite any request that’s URL path is either not /maintanence or does start with /images/ or /style/.

0

精彩评论

暂无评论...
验证码 换一张
取 消