I got a website that using osCommerce which all the page can be access directly with http://www.example.com/pagename.php
, but now I would like to tweak the htaccess file so that it can supports http://www.example.com/username
and then redirecting to http://www.example.com/account.php?id=username
, while other pages still can be access using the same old way.
It means that if the htaccess detect that the URL didn’t have any extension, then it will be redirecting to http://www.example.com/account.php?id=username
.
Thank you!
2
Answers
You can use this code to remove php extension from URL:
You just need one rule: