的.htaccess重定向到全IP的,但我的我的、重定向、htaccess、IP

2023-09-02 09:36:13 作者:卿九

基本上,我想工作,在网站的前端,但我想每个人,但我被重定向到一个建筑页面,如果你喜欢。我目前有:

Basically, I am trying to work on the front end of a website, but I would like everyone else but myself to be redirected to a construction page if you like. I currently have:

redirect 301 /index.php http://www.domain.com/construction.php

在这个工程,它的工作原理来得好,我希望能仍然看到直播现场自己,是有可能排除每个人,但我的IP?

While this works, it works to well, I would like to be able to still see the live site myself, is it possible to exclude everyone but my IP?

再次感谢。

推荐答案

您可以使用mod_rewrite的做到这一点。

You could do it with mod_rewrite

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !=123.45.67.89
RewriteRule index.php$ /construction.php [R=301,L]