Rewrite (or redirect?) index.php/html/htm

New to mod_rewrite? This is a good place to start.

Rewrite (or redirect?) index.php/html/htm

Postby smatts » Sun Aug 02, 2009 2:55 pm

I have a file template.php, which I use as a basic template thing.

I want index.php/etc. to point to template.php?id=home

Thanks.
smatts
 
Posts: 6
Joined: Fri Jul 14, 2006 7:50 pm

Postby richardk » Sun Aug 02, 2009 3:24 pm

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^index\.[^/]+$ /template.php?id=home [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby smatts » Sun Aug 02, 2009 3:29 pm

I had to remove the "/" before the template.php part for some reason, but all else worked perfectly.

Thanks much.
smatts
 
Posts: 6
Joined: Fri Jul 14, 2006 7:50 pm


Return to Beginner's Corner

Who is online

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

cron