Page 1 of 1

Mod Rewrite with PHP question

Posted: Tue Oct 17, 2006 4:31 pm
by amir
Hello how would you write a .htaccess modrewrite to do the following.

I simply want to be able to form my urls like this:

http://www.domainname.com/item1/item2

and it will rewrite to do the following:

http://www.domainname.com/index.php?page=item1&id=item2

Can someone please tell me how to write this mod rewrite?

thanks!

Posted: Tue Oct 17, 2006 4:35 pm
by feyd
There've been a lot of posts concerning that. Take a look around in this (Apache, IIS, Web Servers) board.

Posted: Wed Oct 18, 2006 3:48 am
by ibbo

Code: Select all

RewriteEngine on
RewriteRule (.*)/(.*)/ ?page=$1&id=$2
Your URL would look like http://www.domainname.com/item1/item2/

ibbo

Posted: Sun Oct 29, 2006 7:37 am
by ianhull
Where would I put this code?

Code: Select all

RewriteEngine on 
RewriteRule (.*)/(.*)/ ?page=$1&id=$2
thanks.