【发布时间】:2016-01-21 00:29:35
【问题描述】:
我有以下问题:
如果我在页面 example.com/foo/bar 打开我的网站,每个样式表都会像这样加载:
来源:
<link href="css/style.css" rel="stylesheet" type="text/css">
但是我的服务器会像这样加载这个文件:foo/css/style.css
现在我想更改我的 .htaccess RewriteEngine 以防止这种情况发生,然而我不想使用 RewriteRule 来阻止 /css/换URL!
我的.htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?urlparam=$1 [NC,L]
提前致谢 ;)
【问题讨论】:
标签: html apache .htaccess mod-rewrite url-rewriting