的.htaccess
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
的index.php
<link href="http://example.com/views/cp/css/style.css" />
由于.htaccess重写规则而未读取的样式更改它。 我怎么能用相同的.htaccess文件呢?
答案 0 :(得分:1)
请避免为真实文件和目录重写它:
# If the request is not for a valid directory
RewriteCond %{REQUEST_FILENAME} !-d
# If the request is not for a valid file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]