.htaccess Rewrite后css&js错误
程序员文章站
2022-06-09 09:50:16
...
这是我的.htaccess文件
# BEGIN qiaoyixuan
RewriteEngine on
RewriteBase /qiaoyixuan/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
# END qiaoyixuan
我希望所有地址请求都被Rewrite到index.php,
当请求http://localhost/qiaoyixuan/2015时页面正常显示,
当请求http://localhost/qiaoyixuan/2015/(多一个‘/’)时,css和js出现错误
求解答,谢谢!
回复内容:
这是我的.htaccess文件
# BEGIN qiaoyixuan
RewriteEngine on
RewriteBase /qiaoyixuan/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
# END qiaoyixuan
我希望所有地址请求都被Rewrite到index.php,
当请求http://localhost/qiaoyixuan/2015时页面正常显示,
当请求http://localhost/qiaoyixuan/2015/(多一个‘/’)时,css和js出现错误
求解答,谢谢!
页面里面引用css和js的时候 没以 /
开头?