如何使用 htaccess 将网站访问限制为仅几个网页和 IP 地址
使用以下
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !/temp_page.php$
RewriteCond %{REQUEST_URI} !/thanks.php$
RewriteCond %{REMOTE_HOST} !^90\.333\.222\.111
#RewriteCond %{REMOTE_HOST} !^127\.0\.0\.1
RewriteRule $ /temp_page.php [R=302,L]
可以让我自己(ip)查看所有页面,而其他人只能查看temp_page和thanks.php。我在 temp_page 和thanks.php 上链接了图像和css 文件,但它们不起作用,如何修改 RewriteCond 以便它允许 /js/.、/css/. 和 /images/. 以及?
如果需要更多信息,请告诉我。
谢谢。
Using following
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !/temp_page.php$
RewriteCond %{REQUEST_URI} !/thanks.php$
RewriteCond %{REMOTE_HOST} !^90\.333\.222\.111
#RewriteCond %{REMOTE_HOST} !^127\.0\.0\.1
RewriteRule $ /temp_page.php [R=302,L]
can allow myself (ip) to view all pages, and other get to view only temp_page and thanks.php. I've images and css files linked on temp_page and thanks.php but they dont work, how do I modify RewriteCond so that it allows /js/., /css/., and /images/. as well??
please let me know if need more info.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
添加
应该有效。
Adding
should work.