Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图弄清楚如何让我.htaccess将主页 URL 重定向到子目录(domain.com > domain.com/sub/sub),但我仍然希望 URL 显示为 domain.com。
.htaccess
在过去的一个小时里,我环顾四周,尝试了一些我发现的建议,但都没有奏效。
有任何想法吗?
通过启用 mod_rewrite 和 .htaccess httpd.conf,然后将此代码放在您.htaccess的DOCUMENT_ROOT目录下:
httpd.conf
DOCUMENT_ROOT
Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteRule ^$ /sub/sub [L]