Bob
Bob

Reputation: 177

apache rewrite rule not working

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

Upvotes: 1

Views: 1040

Answers (1)

anubhava
anubhava

Reputation: 784888

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

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

Upvotes: 1

Related Questions