<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ index.php [L]
RewriteRule (.*) index.php [L]
</IfModule>
这样之后,把所有url都解析到我的index.php中,但是页面的css和js也被解析了,求解。
------解决方案--------------------
控制一下条件
- PHP code
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php [L] </IfModule>
------解决方案--------------------
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule (captcha.php) images/captcha.php [L]
RewriteRule (filter.js) scripts/filter.js [L]
RewriteRule (jquery.js) scripts/jquery.js [L]
RewriteRule (.css) styles/styles.css [L]
RewriteRule (.*) index.php [L]
</IfModule>