.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

測試您的網站是否有惡意程式

Urlvoid.com 是  NoVirusThanks  這家公司發展的免費服務, 提供了20幾個偵測引擎來偵測網站的安全性,是否有惡意程式值入網站。網址:...

解決IE與chrome 無法正常顯示雲端主機頁面之問題

設定IE9顯示混合內容於IE9 →「網際網路選項」→「安全性」→「網際網路」→「自訂等級」→「顯示混合的內容」中,點選『啟用』即可。...

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...

VPS、實體主機的代管與非代管之意義為?

代管服務僅對於客戶主機使用cPanel 或 Plesk...

HTTP Status Codes ( 狀態碼 )

HTTP CODES - 100-101 100 - Continue ( 繼續 ) Tells the client that the first part of the...