1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to remove file extension from URL??

Discussion in 'BlackHat Lounge' started by umerjutt00, Jun 16, 2013.

  1. umerjutt00

    umerjutt00 Jr. VIP Jr. VIP Premium Member

    Joined:
    Oct 28, 2011
    Messages:
    3,645
    Likes Received:
    1,906
    Occupation:
    Ninja
    How I can remove the file extension from the url. Let's say my url is www.mysite.com/page.php and i want to open this page without writting .php at the end like www.mysite.com/page.

    I have tried using htaccess but it is showing internal server error.
     
  2. jp_smith86

    jp_smith86 Senior Member

    Joined:
    Jul 6, 2012
    Messages:
    855
    Likes Received:
    340
    Location:
    DIL APNA PUNJABI
    Home Page:
    You can create a folder. name it as your page name is. and then can create a php file with index.php in that folder and can insert code into that file. then it will remove .php from the URL..

    Then it will be http://www.mysite.com/folder

    Let me know if you need any help in this.

    THanks
    Palwinder
     
    • Thanks Thanks x 1
  3. umerjutt00

    umerjutt00 Jr. VIP Jr. VIP Premium Member

    Joined:
    Oct 28, 2011
    Messages:
    3,645
    Likes Received:
    1,906
    Occupation:
    Ninja
    Thanks man. It just solved my problem. +rep
     
  4. Fateless

    Fateless Newbie

    Joined:
    Sep 10, 2011
    Messages:
    16
    Likes Received:
    3
    Location:
    Portugal
    using htaccess is possible like this:

    RewriteEngine on

    RewriteRule ^Registration/?$ registration.php?id=$1 [L]

    simple and easy
     
  5. elviswong

    elviswong Senior Member Premium Member

    Joined:
    Nov 8, 2011
    Messages:
    918
    Likes Received:
    240
    What he says. It's the simplest method
    You can also work with subdomains. So it could be folder.yoursite.com instead