View Full Version : Redirect or rewrite with htaccess

03-24-2007, 05:07 AM
Ok I am remaking my website, but there are links to multiple pages on my current one. Theres about 10 or so of these. So I simply want to point these 10 old ones to their new location on my website. The Domain name is the same, just how they are stored in MySQL is different.

lets say currently one of my pages is at


my new location will be


Please note I havn't actually switched my new system over, so ?category2&id=3 still exist.

so I have tried

Redirect permanent http://www.mydomain.com/index.php?category=2&id=3 http://www.mydomain.com/index.php/category/2/3

in my htaccess,

and when I go to http://www.mydomain.com/index.php?category=2&id=3 it still works. Is this because I have to actually remove the page before it will redirect it?

I know htaccess shouldn't be this hard, I basically want to test it out on my webhost make sure it is working and I understand it before I move over to my new system.

BTW my host is 1and1, on a linux server.

Thanks for you responses in advance

03-25-2007, 06:32 PM

03-27-2007, 05:44 PM
I'm not sure about having to remove the old page, but I know if you put [R=301] at the end of your rewrite rule, it will update the URL in the browser. Otherwise it will keep the same url no matter what page it redirects to.

Redirect http://www.mydomain.com/index.php?category=2&id=3 http://www.mydomain.com/index.php/category/2/3 [R=301]