内部网址:example.com/abc/xyz/rule.php?price=1&pass=2
外部网址:example.com/abc/xyz/rule/1/2
但是css,js文件在外部URL中没有生效。 我的.htaccess文件:
RewriteEngine On
RewriteBase /example.com/abc/
RewriteRule ^rule/([0-9]+)/([0-9]+)/?$ rule.php?price=$1&pass=$2
答案 0 :(得分:1)
“问题”是相对URL由客户端而不是服务器解析。基本URL(从中解析相对URL)是当前文档的URL。在您的情况下,基本网址(路径)为/abc/xyz/rule/1/2
而不是/abc/xyz/rule.php?price=1&pass=2
。
现在你有几种方法可以解决这个问题:
/abc/xyz/rule/1/2
BASE
element