homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

CSS not loading with htaccess rewrite rule

5+ Year Member

Msg#: 4400840 posted 9:56 am on Dec 23, 2011 (gmt 0)

Hai all,

Im using the rewriterule in htaccess for seo friendly url

the url re-writing is working and page is getting displayed..but problem is its not loading the css and images...

Options +FollowSymLinks
RewriteEngine On

RewriteBase /final/

RewriteRule ^books/(.*)/product-([0-9]+)\.html$ productpage.php?name=$1&&productid=$2

Can you please check out what am missing in above code

Awaiting for your replys



WebmasterWorld Senior Member lucy24 us a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

Msg#: 4400840 posted 10:22 am on Dec 23, 2011 (gmt 0)

:: peering into crystal ball ::

You have used relative links for your CSS and images. The rewrite means that these extra files are not where the browser thinks they are.

Solution: Use site-absolute links (the kind with a leading / slash) in all files that are to be rewritten.

g1 will be along presently to say: use site-absolute links all the time, everywhere

Oh, and do something about that (.*) in the middle of the pattern. It's slowing down your server. You probably mean \w+ or [^/]+.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved