[英]Rewrite Rule exclude certain strings from (.*) in Regex
我目前有以下htaccess重寫規則:
RewriteRule (.*) index.php/$1 [L]
如何排除2個特定字符串,例如“ template”和“ image”?
我讀了其他帖子,但我不清楚。
您可以做出否定的重寫條件
像這樣:
RewriteCond %{REQUEST_URI} !^/(template|image)
RewriteRule (.*) index.php/$1 [L]
它實際上不會重寫指向圖像和模板文件夾中內容的所有url。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.