[英]Don't rewrite URLs which represent files
# These settings routes all traffic, except concrete files, to the dispatcher
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(.*)$ index.php [NC,L]
問題是它確實將具體文件路由到調度程序:(
我http://site.com/style.css
才能忽略諸如http://site.com/style.css
類的URL?
試試這個,讓我知道:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule . /index.php [NC,L]
您正在將所有內容都重寫到index.php,這將檢查文件/文件夾/符號鏈接是否存在,如果存在,則將其加載。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.