Page 1 of 1

Mod rewrite urls and images

Posted: Fri Jul 15, 2005 9:58 am
by phpdevuk
I know that somewhere someone has probably covered this, but I'm trying to use mod rewrite to take a url in the form of http://www.mysite.org/country/gb and rewrite it to go to http://www.mysite.org/country.php?code=gb

My .htaccess currently look like this, and does do what I want

Code: Select all

RewriteEngine On 
rewriteRule ^country/(.*)$ country.php?code=$1
problem is I get all images and links going to the wrong place so the page looks broken. I've read somewhere that I simply need to add rules for images etc, but I am stumped so far with getting anything to work.

Anyone help?

Posted: Fri Jul 15, 2005 11:30 am
by phpdevuk
found a basic fix using the html tag base in the header file

Code: Select all

<base href=&quote;http://www.mysite.org&quote;>