Get ready for BLACK FRIDAY shopping starting in

Forums

PHP

This topic is locked

.htaccess RewriteRule

Posted 12 Jan 2009 13:54:29
1
has voted
12 Jan 2009 13:54:29 agatqua a posted:
I'm trying to make my website more SEO friendly by changing URLs from dynamic to static and I've come across a problem.

When I do a RewriteRule with one parameter everything works fine but as soon as I add the second parameter the page shows but as though it couldn't see the css file and all jpg files. It just shows a simple html version of the page.

This works perfectly:
RewriteRule ^([a-zA-Z0-9_-]+)/([0-9]+)$ /Pages/category_products.php?CategoryID=$2

And this is what doesn't work:
RewriteRule ^([a-zA-Z0-9_-]+)/([0-9]+)/([0-9]+)$ /Pages/category_products.php?CategoryID=$2&pageNum_rsProducts=$3

Please reply if you know why the page wouldn't connect to the css and jpg files.

Replies

Replied 24 Apr 2009 19:34:53
24 Apr 2009 19:34:53 Sofus Comer replied:
I would guess, that making the path to your css, javascripts, images etc look like this:

ADDING THE "/" before all relative paths

<link href="/admin.css" rel="stylesheet" type="text/css" />
<script src="/../some javascriptfile.js" type="text/javascript"></script>
[img]/../../images/myphoto.jpg">

etc etc...
I am only guessing, and you will have to try it out and post succes or not here again.
Atb Sofus

Edited by - Sofus Comer on 24 Apr 2009  19:35:50

Reply to this topic