.htaccess 如何使用htaccess隐藏网页的名称

.htaccess 如何使用htaccess隐藏网页的名称,.htaccess,mod-rewrite,.htaccess,Mod Rewrite,我想在应用重定向规则后在URL中隐藏网页名称: 以下是my.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的用

我想在应用重定向规则后在URL中隐藏网页名称:

以下是my.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的用户重定向到我想要的页面,但在此之后,我还希望在用户的浏览器地址栏中隐藏新网页的名称(这里是index2.html),以便显示的URL变为multiserver.example.com/user1/


任何帮助都将不胜感激

不要使用浏览器重定向(
[R=301]
),而是使用内部代理标志:
[p]

RewriteRule ./* http://multiserver.example.com/user1/index2.html [P,L]

这样,浏览器的地址栏不会改变,因为它不会从服务器获得301响应。

现在它保持URL不变,但不再重定向到index2.html。它给出了一个未找到的错误:-(有人能帮我解决这个问题吗?我不知道为什么将
R=301
更改为
P
不起作用。URL没有更改。不,我确实想更改URL。它应该将用户从user1/index.html重定向到user1/index2.html,但不应该在浏览器的地址栏中显示此更改。它应该在bro中显示相同的内容。)wser的地址栏。