我正在使用 mod_rewrite 为我正在开发的网站创建更漂亮的 URL。但是,我的 css 和 js 文件夹会导致重定向循环。
这是我的 .htaccess 中的内容
AddDefaultCharset On
AddDefaultCharset UTF-8
AddCharset UTF-8 .tpl
AddCharset UTF-8 .js
AddCharset UTF-8 .css
AddCharset UTF-8 .php
RewriteEngine On
RewriteBase /guildtree/
RewriteRule ^([a-zA-Z0-9_'-]+)/(.*)$ characters.php?realm=$1&name=$2 [NC]
我的 CSS 被重定向到
http://localhost/guildtree/css/error
我的 JS 被重定向到
http://localhost/guildtree/js/error
我的图像也都坏了,即使它们的路径是正确的。直接访问图像也会导致重定向循环。
http://localhost/guildtree/images/roster/error
是否有任何突出的原因导致此循环?谢谢。
更新:
CSS 和图像的问题已得到解决。JS仍然不起作用。