当他转到我的URL时,我想向用户显示另一个URL的内容,但不完全更改URL。例: 当他去http://example.com时,我希望他看到http://example.com/another/url的内容 但是我希望他相信(在浏览器中看到)他给定的URL。 如何使用.htaccess做到这一点?有什么建议吗?
答案 0 :(得分:1)
尝试一下:
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^/(.*)$ http://example.com/another/url/$1 [R=301,L]
答案 1 :(得分:1)
您可以在网站根目录.htaccess中使用此规则:
RewriteEngine On
RewriteRule ^/?$ /another/url [L]
当您在浏览器中请求/another/url
时,它将加载http://example.com/
,但不会更改浏览器URL。