.Htaccess不使用CSS和JS

.Htaccess不使用CSS和JS,.htaccess,.htaccess,这是我的原始Url:index.php?page=aboutus,然后我转换成这样:index/page/aboutus 问题是:为什么CSS和JS不起作用 编辑:当前.htaccess: Options +FollowSymLinks RewriteEngine On RewriteRule ^index?$ index.php RewriteRule page/(.*) index.php?page=$1 #fix css, js, image links RewriteRule ^inde

这是我的原始Url:index.php?page=aboutus,然后我转换成这样:index/page/aboutus

问题是:为什么CSS和JS不起作用

编辑:当前
.htaccess

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^index?$ index.php
RewriteRule page/(.*) index.php?page=$1
#fix css, js, image links
RewriteRule ^index/(.+?\.(?:jpe?g|gif|bmp|png|tiff|css|js))$ /$1 [NC,L]

请显示您的htaccess代码。选项+FollowSymLinks RewriteEngine On RewriteRule^index?$index.php RewriteRule page/(*)index.php?page=$1#修复css、js、图像链接RewriteRule^index/(.+?\(?:jpe?g | gif | bmp | png | tiff | css | js))$/$1[NC,L]我已将您的代码添加到问题中-请编辑问题,因为注释不会保留换行符。关于您的问题,您很可能没有在HTML中使用根相对引用。您需要确保CSS链接具有前导斜杠(
/my/styles.CSS
而不是
my/styles.CSS
),以确保它们相对于站点的根进行加载。或者,您可以将
添加到HTMLIf的
中。如果您这样做,您可以删除
.htaccess
文件中的最后一条规则-这将变得多余(不需要)。感谢您友好的回答,但这并不能解决我的问题。