1
我的.htaccess代碼:的.htaccess子域目錄
RewriteRule ^404\.php$ - [L]
Rewritecomnd %{HTTP_HOST} !^www\.example\.com
Rewritecomnd %{HTTP_HOST} ([^.]+)\.example\.com [NC]
RewriteRule ^/?$ /profile/index.php?name=%1 [L]
Rewritecomnd %{HTTP_HOST} !^www\.example\.com
Rewritecomnd %{HTTP_HOST} [^.]+\.example\.com [NC]
Rewritecomnd %{REQUEST_URI} ^/([^/]+)$
RewriteRule !^profile/ /profile/%1 [L]
讓我告訴你這是什麼一樣:
bob.example.com
顯示頁www.example.com/profile/index.php?name=bob
bob.example.com/page1.php
顯示頁面僅輪廓目錄www.example.com/profile/page1.php
問:
的問題是,如果我去bob.example.com/directory/page.php
,這說明我的根目錄的目錄。我怎樣才能讓 bob.example.com/directory/page.php
顯示www.example.com/profile/directory/page2.php
?
你是天才,謝謝! –