Forum Moderators: phranque
I am now implementing mod_rewrite into a CMS.
The problem i have ran into is the link for images changes and I really cannot add a / to every image in the CMS....that would take just way to long.
How can i redirect all images to their appropriate locations as some images are loaded from the images folder and some images are located in /themes/theme folder I've looked through the forums and couldnt find a solution to this,
What i am trying to accomplish is say i got to
Copied from my browser
[localhost...]
all image locations are now
/news/view_news/images
or
/news/view_news/themes/Theme_Name
how do i fix this?
heres some of the rewrite code i came up with
RewriteEngine on
RewriteRule ^/([A-Za-z]+)/?$ index.php?page=$1 [L,NS]
RewriteRule ^news/([A-Za-z]+)?$ index.php?page=news&func=$1 [L,NS]
RewriteRule ^news/view_news/([0-9]+)?$ index.php?page=news&func=view_news&news_id=$1 [L,NS]
Correct Image Urls :
images/image1.gif
images/sub/image2.gif
themes/themename/images/etc/image.gif
etc etc...
and they come up as so i load this page
[localhost...]
news/view_news/images/image1.gif
news/view_news/themes/themename/images/etc/image.gif
Jim