URL rewrite to remove parameters

Posted by samoyed on Stack Overflow See other posts from Stack Overflow or by samoyed
Published on 2011-02-05T23:15:09Z Indexed on 2011/02/05 23:25 UTC
Read the original article Hit count: 182

Filed under:
|
|
|

Hello to all,
I'm working on a site where all the pages are actually index.php + a 'name' parameter that is analyzed and loads the appropriate template and content.
the homepage url is:
http://www.some_site.com/?page=homepage

1. i was asked to "change" the homepage url to:
http://www.some_site.com
can i use url rewite and htaccess for that and if so, what should i write there?

working on my local machine, i tried this code (mode rewrite is enabled):

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteRule /index.php /index.php?page=homepage
</IfModule>

i would still need the 'name' parameter to be available to the php code of course, so i can load the template and css files.

2. it would be nice for other pages (not homepage) to be converted from (example)
http://www.some_site.com/?page=products
to:
http://www.some_site.com/products
this is less crucial.

thanx in advance and have a nice day :-)

© Stack Overflow or respective owner

Related posts about php

Related posts about apache