gpt4 book ai didi

.htaccess - .htaccess重定向到除我之外的所有IP

转载 作者:行者123 更新时间:2023-12-03 10:06:32 24 4
gpt4 key购买 nike

基本上,我正在尝试在网站的前端工作,但是如果您愿意,我希望除我之外的其他所有人都重定向到构建页面。我目前有:

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

尽管此方法有效,但效果很好,我希望自己仍然可以看到实时站点,是否可以排除IP以外的所有人?

再次感谢。

最佳答案

您可以使用mod_rewrite

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

关于.htaccess - .htaccess重定向到除我之外的所有IP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8985502/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com