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.
我有foo.com一个用户登录并被重定向到的网站foo.com/boo/foo.php。foo.com无论用户访问哪个目录,都可以只显示吗?不确定他们的问题是否清楚......在此先感谢!
foo.com
foo.com/boo/foo.php
通过启用 mod_rewrite 和 .htaccess httpd.conf,然后将此代码放在您.htaccess的DOCUMENT_ROOT目录下:
httpd.conf
.htaccess
DOCUMENT_ROOT
Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^(www\.)foo\.com$ [NC] RewriteRule ^$ boo/foo.php [L]