.htaccess: 重寫規則工作一貫的子域和子目錄

有沒有辦法讓規則適用於子域和子目錄?

可參考下列範例自行修改
Options+FollowSymlinks-MultiViews
RewriteEngineOn
RewriteBase/blog
RewriteCond%{HTTP_HOST} blog\.example\.com [NC]
RewriteCond%{QUERY_STRING} !page_id= [NC]
RewriteRule^meetings /?page_id=2809 [L,NC]
RewriteCond%{HTTP_HOST} ^(www\.)?example\.com [NC]
RewriteCond%{QUERY_STRING} !page_id= [NC]
RewriteRule^meetings /blog/?page_id=2809 [L,NC]

永久重定向,取代[ L,R = 301與[ L ],NC,NC ]。

原文
http://codex.wiki/question/1407589-4747

 
  • 0 istifadəçi bunu faydalı hesab edir
Bu cavab sizə kömək etdi?

Uyğun məqalələr

How to Create a phpinfo File?

In the phpinfo.php page, the PHP version can be seen at the top of the file, listing the current...

500 Internal Server Error ,Service Temporarily Unavailable! ,Resource Limit Is Reached!

為何網站會出現下列錯誤訊息?!Internal Server ErrorThe server encountered an internal error or misconfiguration...

我訂的是亞州機房,為何會顯示是美國IP?

要判定機房位置,可從Ping/Trace Route 來查詢。若在亞州對亞州國家連線之ping值 一定會小於100ms,而亞州對美國之ping 值一定會大於100ms。這是重要的判斷依據。...

什麼是虛擬主機?

虛擬主機指的是使用者操作一台電腦提供放置檔案的空間....

月流量是怎麼計算呢?會不會很快就用完了?

流量大小可依照您網頁的大小或數量、還有瀏覽者多寡來決定假如 一個網頁含圖片至多500KB ,那月流量15G約估計為15,000MB=15,000,000KB...