Rewrite css/js paths

Posted by wooptoo on Stack Overflow See other posts from Stack Overflow or by wooptoo
Published on 2010-04-05T14:49:57Z Indexed on 2010/04/05 14:53 UTC
Read the original article Hit count: 200

Filed under:
|

So I rewrote my paths to something like: URL/really/nice/paths/ using mod_rewrite rules like this:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [PT,L]
</IfModule>

The question is how could I rewrite the paths for js/css/image files too, so when they are requested with a relative path from URL/really/nice/path/ to be served from URL/scripts/, URL/styles/ and URL/images/ folders instead? Can this be done without using RewriteBase?

© Stack Overflow or respective owner

Related posts about .htaccess

Related posts about mod-rewrite