这是我当前的.htaccess文件:
RewriteEngine On
RewriteBase /application/
RewriteRule (.*)/css/(.*).css www/$1/css/$2.css
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) index.php?p=$1
所以我的最终目标是
http://localhost/application/guestbook/css/style.css
转发到
/application/www/guestbook/css/style.css
它几乎正常工作,但当我倾销$ _GET时,我可以看到他正在寻找的网址是
www/www/guestbook/css/style.css
有人可以告诉我为什么它有2次www /?我该如何解决?
答案 0 :(得分:2)
这是一种方法:
<强>已更新强>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^.*/(\w+/\w+/\w+\.css)$
RewriteRule .* application/www/%1 [L]
将重定向此:
http://localhost/application/anything1/anything2/anything3.css
到
http://localhost/application/www/anything1/anything2/anything3.css