Moose Moose
Moose Moose

Reputation: 267

Trying to change stylesheet url

This is my current .htaccess file:

RewriteEngine On

RewriteBase /application/

RewriteRule (.*)/css/(.*).css www/$1/css/$2.css

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) index.php?p=$1

So my end goal here is to have

http://localhost/application/guestbook/css/style.css

forwarded to

/application/www/guestbook/css/style.css

It's almost working, yet when im dumping $_GET i can see that the url he's looking for is

www/www/guestbook/css/style.css

Can someone tell me why its having 2times www/ ? And how can I fix it?

Upvotes: 1

Views: 82

Answers (1)

Felipe Alameda A
Felipe Alameda A

Reputation: 11809

Here is one way to do it:

UPDATED

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^.*/(\w+/\w+/\w+\.css)$
RewriteRule .* application/www/%1 [L]

Will redirect this:

http://localhost/application/anything1/anything2/anything3.css to

http://localhost/application/www/anything1/anything2/anything3.css

Upvotes: 2

Related Questions