【发布时间】:2021-07-03 08:16:29
【问题描述】:
例如我的子域是 abc.example.com
我的文件夹是 /htdocs/abcfiles
我的要求是当我访问 url http://abc.example.com 时。 它将显示“abcfiles/”文件夹中的网页。
我的 .htaccess 文件
RewriteEngine On
RewriteCond %{HTTP_HOST} ^abc.example.com$
RewriteCond %{REQUEST_URI} !^/abcfiles/
RewriteRule (.*) /abcfiles/$1 [L]
RewriteBase /abcfiles/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /abcfiles/index.php [L]
它可以工作,但在某些链接中显示“/abcfiles/”。即 abc.example.com/abcfiles/...
【问题讨论】: