1

这是我当前的 .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/ 吗?我该如何解决?

4

1 回答 1

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

于 2012-12-08T17:23:25.710 回答