Forum Moderators: phranque

Message Too Old, No Replies

Rewriting rule

Images, css files and js file is not being read

         

zaira_86

11:51 am on Mar 13, 2010 (gmt 0)

10+ Year Member



Hi, i'm newbie to htaccess. May i know why when i have this rule it redirects me to the correct page but the page is all mess up. Images is not showing up. It seems that the css file, js file and images is not being read. How do i fix this? Any idea please?
Here is the rule:
RewriteRule ^category/([^/]+)/([^/]+)$ listing.php?catname=$1&page=$2 [nc]

I'm not sure if i am doing right in the code.

g1smd

8:07 pm on Mar 13, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Links to the images, and to any CSS and JS files should begin with a leading slash, and should specify the /full/path/to/the/file.

zaira_86

2:46 am on Mar 14, 2010 (gmt 0)

10+ Year Member



You mean instead of declaring it this way
<link href="css/listing.css" rel="stylesheet" type="text/css" />

i have to make it
<link href="http://www.mysite.com/css/listing.css" rel="stylesheet" type="text/css" />

Is there isn't a way that i wont be declaring a fullpath link when rewriting htaccess in my site?

zaira_86

2:49 am on Mar 14, 2010 (gmt 0)

10+ Year Member



You mean instead of declaring it this way
<link href="css/listing.css" rel="stylesheet" type="text/css" />

i have to make it
<link href="http://www.mysite.com/css/listing.css" rel="stylesheet" type="text/css" />

Is there isn't a way that i wont be declaring a fullpath link when rewriting htaccess in my site?

g1smd

7:21 am on Mar 14, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Instead of declaring it this way
<link href="css/listing.css" rel="stylesheet" type="text/css" />

you have to make it
<link href="/css/listing.css" rel="stylesheet" type="text/css" />