我希望在应用重定向规则后隐藏URL中的网页名称:
以下是我的.htaccess文件的内容:
RewriteEngine On
RewriteCond %{REMOTE_ADDR} ^192\.168\.199\.129$
RewriteCond %{REQUEST_URI} !/index2.html$ [NC]
RewriteRule ./* http://multiserver.example.com/user1/index2.html [R=301,L]上面的规则允许我将具有特定ip的用户重定向到我想要的页面,但在此之后,我还希望在用户的浏览器地址栏中隐藏新web页面的名称(此处为index2.html),以便显示的URL变为multiserver.example.com/user1/。
任何帮助都将不胜感激。
发布于 2012-07-01 00:22:46
使用内部代理标志:[P],而不是浏览器重定向([R=301]
RewriteRule ./* http://multiserver.example.com/user1/index2.html [P,L]这样,浏览器的地址栏就不会改变,因为它不会从服务器获得301响应。
https://stackoverflow.com/questions/11272768
复制相似问题