Home >Backend Development >PHP Tutorial >.htaccess Rewrite后css&js错误

.htaccess Rewrite后css&js错误

WBOY
WBOYOriginal
2016-06-06 20:21:251524browse

这是我的.htaccess文件

<code># BEGIN qiaoyixuan
<ifmodule mod_rewrite.c>
RewriteEngine on
RewriteBase /qiaoyixuan/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</ifmodule>
# END qiaoyixuan
</code>

我希望所有地址请求都被Rewrite到index.php,
当请求http://localhost/qiaoyixuan/2015时页面正常显示,
当请求http://localhost/qiaoyixuan/2015/(多一个‘/’)时,css和js出现错误
.htaccess Rewrite后css&js错误
求解答,谢谢!

回复内容:

这是我的.htaccess文件

<code># BEGIN qiaoyixuan
<ifmodule mod_rewrite.c>
RewriteEngine on
RewriteBase /qiaoyixuan/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</ifmodule>
# END qiaoyixuan
</code>

我希望所有地址请求都被Rewrite到index.php,
当请求http://localhost/qiaoyixuan/2015时页面正常显示,
当请求http://localhost/qiaoyixuan/2015/(多一个‘/’)时,css和js出现错误
.htaccess Rewrite后css&js错误
求解答,谢谢!

页面里面引用css和js的时候 没以 / 开头?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn