0
我添加以下重寫conf文件爲我的虛擬主機:虛擬主機的conf文件重定向添加本地文件路徑
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
.... A bunch of aliases here
該網站工作正常的WWW。但是如果你輸入的域沒有www。該網站將被重定向到www.example.com/home/example/public_html - 它會添加文件路徑。我怎樣才能防止這一點?
這裏的別名:
Alias /index.php /home/cms/public/index.php
Alias /skins/admin /home/cms/public/skins/admin
AliasMatch ^/scripts/(\w+)/admin/(\w+)\.js /home/cms/modules/$1/scripts/admin/$2.js
AliasMatch ^/scripts/(\w+)/(\w+)\.js /home/cms/modules/$1/scripts/$2.js
Alias /scripts /home/cms/public/scripts
AliasMatch (?i)^/flash/([A-Za-z]*)/([A-Za-z_]*).swf$ /home/cms/public/flash/$1/$2.swf
Alias /css /home/cms/public/css
Alias /thirdparty /home/cms/public/thirdparty
RewriteEngine off
<Directory /home/cms>
Order allow,deny
Allow from all
</Directory>
<Location />
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /index.php [NC,L]
</Location>
你能否提供一些關於你的別名的信息?請求應該像這樣工作。 – 2011-05-25 21:08:18
添加別名 – Ashley 2011-05-25 21:50:06
您的虛擬主機可以配置更高級別的規則嗎? public_html通常用於每個用戶的配置。 – 2011-05-25 21:58:47