rewrite www.foobar.com?querystring into www.foobar/newdir/

Using mod_rewrite to handle various content issues

rewrite www.foobar.com?querystring into www.foobar/newdir/

Postby cgfreak » Sun May 04, 2008 5:27 am

Hi,
I have a this url...
http://www.foobar.com/detail.php?item_id=208&page_id=21
and I need it to be...
http://www.foobar.com/memorial/

Is mod rewrite the best thing for this?
This is the only rewrite required for the site so all other links need to stay intact as they are.

Please help, this rewrite stuff is tough!
Cheers
cgfreak
 
Posts: 4
Joined: Sun May 04, 2008 5:11 am

Postby richardk » Mon May 05, 2008 3:57 pm

Try the following in a .htaccess file in your document root
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^memorial/?$ /detail.php?item_id=208&page_id=21 [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Solved!

Postby cgfreak » Tue May 06, 2008 1:39 am

Superb. Thanks very much. Problem solved.
cgfreak
 
Posts: 4
Joined: Sun May 04, 2008 5:11 am


Return to Content

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron