开发者

apache rewrite rule not working

开发者 https://www.devze.com 2023-03-09 10:45 出处:网络
I have the following rewrite rule: RewriteEngine on RewriteRule /stylesheets/[0-9]+/(.*)$/stylesheets/$1 [L]

I have the following rewrite rule:

RewriteEngine on
RewriteRule /stylesheets/[0-9]+/(.*)$      /stylesheets/$1 [L]

So in the html I 开发者_运维问答can say /stylesheets/05282011/xxx.css and it points to /stylesheets/xxx.css

This looks correct to me but can anyone spot why it wouldn't work?

Thanks


Problem is starting slash / because that is stripped by Apache. Try this rule:

RewriteRule ^stylesheets/[0-9]+/(.*)$  /stylesheets/$1 [L]
0

精彩评论

暂无评论...
验证码 换一张
取 消