0

是否有可能做到这一点,当访问者键入example.com他们最终到达时example.com/sub/folder/,即显示 URL 栏example.com/sub/folder/

这是我现在的 .htaccess 文件:

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
4

1 回答 1

0

尝试:

RewriteMatch 301 ^/$ /sub/folder

或者:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/sub/folder
RewriteRule ^(.*)$ /sub/folder/$1 [L,R=301]
于 2013-10-01T23:11:50.247 回答