我在htaccess中使用以下重写规则进行URL重定向。
RewriteEngine On
RewriteRule ^users/('d+)*$ ./blog.php?id=$1
在blog.php文件中,我使用了类似的csspath
<link rel="stylesheet" href="./css/default.css" type="text/css" />
如果我输入http://www.example.com/blog.php?id=1它运行良好。
但是如果我输入urlhttp://www.example.com/users/css路径更改为
<link rel="stylesheet" href="users/css/default.css" type="text/css" />
如何纠正?
在尝试其他规则之前先尝试此规则:
RewriteRule ^(css|js)($|/) - [L]
这将结束重写过程。