how to hide .php extension from url?
Please help me to hide .php extension from my website url. i want to like that.
http.www.mydomain.index.php to http.www.mydomain
and www.mydomain.com/about-us.php to www.mydomain.com/about-us
so please help me, how its be possible.
you need to use htaccess rewrite rules for this
Well that is simple .. most servers already have the feature available as every homepage requires an index (index.htr,index.html,index.php) so on so forth..
All you need to do is create a directory for each address so for example
you would create a folder for about-us then copy about-us.php into that new folder, rename about-us.php to index.php.
Have fun coding,
whoops miss spell ** (index.htm,index.html,index.php) **
Originally Posted by wolveriene401
There are also frameworks like SLIM php that offer easy ways to create "routing" rules. What is cool about this is it analyzes the URL path and routes the request to the script and can even disguise variables as part of the path (meaning it will not only hide the extension, but also the "?var1=1&var2=2" ...part of the url). Very cool stuff.
We do precision guesswork
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread