Welcome to WebmasterWorld Guest from 107.21.159.218

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

CSS not loading with htaccess rewrite rule

     

saideep2007

9:56 am on Dec 23, 2011 (gmt 0)

5+ Year Member



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

lucy24

10:22 am on Dec 23, 2011 (gmt 0)

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



:: 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 [^/]+.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month