www.webdeveloper.com
Results 1 to 5 of 5

Thread: how to hide .php extension from url?

Hybrid View

  1. #1

    how to hide .php extension from url?

    Hello Guys,
    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.
    Thanks

  2. #2
    Join Date
    Jul 2005
    Location
    faisalabad, punjab, pakistan
    Posts
    241
    hi,

    you need to use htaccess rewrite rules for this

  3. #3
    Join Date
    Mar 2013
    Posts
    15
    Hey,

    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.

    Simple's

    Have fun coding,

    Wolveriene401

  4. #4
    Join Date
    Mar 2013
    Posts
    15
    Quote Originally Posted by wolveriene401 View Post
    Hey,

    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.

    Simple's

    Have fun coding,

    Wolveriene401
    whoops miss spell ** (index.htm,index.html,index.php) **

  5. #5
    Join Date
    May 2003
    Posts
    599
    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles