rewrite images, css to location...

New to mod_rewrite? This is a good place to start.

rewrite images, css to location...

Postby Bluey » Sun May 17, 2009 5:04 am

I'm rewriting everything except for images, css, js files... too index.php

RewriteRule !\.(xml|txt|css|js|png|jpg|jpeg|gif|doc|ico)$ index.php

Images work fine and resolve to there proper locations

EG.
address - http://localhost/
image path in html - images/example.jpg
resolves too - http://localhost/images/example.jpg

The problem

EG.
address: http://localhost/admin/
image path in html: images/example.jpg
resolves too - http://localhost/admin/images/example.jpg

You can see the problem.

Without modifying all my html paths to be absolute, I've been trying to come up with a second RewriteRule for images, css, js... to resolve too there proper locations..

After writing this up I just realized I could simply use symbolic links *sigh* lol

Anyway, I'd still love to find an way to do the mod_rewrite method.
Bluey
 
Posts: 1
Joined: Sun May 17, 2009 4:47 am

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 3 guests

cron