【发布时间】:2015-06-27 20:10:23
【问题描述】:
我正在开发一个当前位于子域的网站。在 .htaccess 文件中,我有以下内容:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^([a-zA-Z_\-]+)/?$ /index.php?url=$1 [L,NC]
RewriteRule ^([a-zA-Z_\-]+)/(.+)/?$ /index.php?url=$1&$2 [L,NC]
当我尝试加载现有的 css 文件时,例如http://subdomain/path/to/existing/file.css Apache 仍然将其重定向到 index.php。除了现有文件和目录,是否可以将所有 URL 重定向到 index.php?
【问题讨论】: