I used mod_rewrite to shift a url to hirarchy above it, which caused my CSS, Javascript and Image links to break. i.e. it cannot link to teh js, css file as the path changed with the rewrite. This is the current rewrite rule set. And the .htacccess is located in myportal directory. RewriteRule ^([^\s=&$\?][a-z0-9-]+(?:news-([0-9]{1,}))(?:\.s?html?))$ /myportal/php/news_details.php?news_id=$2 [NC,L] Is there a way to fix these embedded broken links using mod_rewrite or do i have to edit the php files manually ?
Hello, i had the same problem and i solved it pretty quickly using in the html head: <base href="http://www.mysite.com/"> ... That helps transforming your relative paths from "folder/style.css" into "http://www.mysite.com/folder/style.css"> ... I hope it helps ...
Thanks a lot mate You guys are amazing and very helpful. I was about re-adjust the hirarchy but was waiting for the reply. Guess it was well worth waiting for the reply. That one line sure saved a lot of work for me.