开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜