[英]htaccess throws 500 Internal error
我有一個帶有子目錄XYZ
和index.php
文件的目錄結構。 XYZ包含用於css,圖像,js等的其他子目錄。我正在嘗試完成以下任務:
http://example.com/my-page
都應映射到http://example.com/xyz?route=my-page
以下是我的.htaccess文件,請提供幫助。
RewriteEngine on
RewriteRule ^((?:gallery|img|css|js).*)$ xyz/$1
RewriteRule ^(.*)$ /xyz/?route=$1 [QSA,L]
有這種方式:
RewriteEngine on
RewriteRule ^(?:gallery|img|css|js)/.*$ xyz/$0 [L,NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ xyz/?route=$1 [QSA,L]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.