Page 1 of 1

Unable to load images and stylesheet after URL rewrite

Posted: Wed Feb 14, 2007 7:52 am
by Rovas
I followed several tutorials for rewriting URL for dinamic to static (i.e products?id=2 to products/2/name_of_product) but I have a problem when I type the modified URL the browser loads the page without images and the CSS style assigned to the HTML elements in the page.
The code is classic for the mod_rewrite ():
the rewrite rules

Code: Select all

//for taking the id value of a product from the new URL format
                               $sir=$_SERVER['PATH_INFO'];
				$sirFinal=explode("/", $sir);
                                $_GET["p"]=$sirFinal[1];

Posted: Wed Feb 14, 2007 8:32 am
by feyd
The paths in your resulting HTML probably don't exist. They likely point to the current directory or a child of it. They probably need to point to the root.

Posted: Wed Feb 14, 2007 8:45 am
by Rovas
Yes they all are relative paths solved it by putting

Code: Select all

<base path="domain">