Hello i an new to Mod_Rewrite and want to use it for the first time, I have one simple request, How do i remove the .php extension from my page and rewrite querystring.
http://localhost/myproject/aboutus.php?page=info
http://localhost/myproject/products.php?page=first-product
i have multiple pages like this and what i need to do is
http://localhost/myproject/aboutus/info
http://localhost/myproject/products/first-product
Likewise aboutus.php?page=moreinfo and product.php?page=second-product and more.
All i need is a simple rule to remove the .php extension from the page and rewrite get page query string for all of my pages. if any one can help ?
Try this in your htaccess (which should be in your
myproject
directory):Every urls, inside your
myproject
directory, matching that rule (for examplesomething/other-thing
) will be rewritten tosomething.php?page=other-thing