Hide extension

Discussion in 'PHP' started by Tintumol, Feb 21, 2011.

  1. #1
    Hi All,

    how can i hide the .php extension in url???
    it is very need to me......pls
     
    Tintumol, Feb 21, 2011 IP
  2. Simple Link Media

    Simple Link Media Peon

    Messages:
    38
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use .htaccess.
     
    Simple Link Media, Feb 21, 2011 IP
  3. arengin

    arengin Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    RewriteRule it's helping
     
    arengin, Feb 21, 2011 IP
  4. Vooler

    Vooler Well-Known Member

    Messages:
    1,146
    Likes Received:
    64
    Best Answers:
    4
    Trophy Points:
    150
    #4
    Create a file with name ".htaccess", while creating this in notepad use double quotes around, I hope it allows you to save the file, and save following in it and uplod to root folder of script. But there should be some pattern that can be used in mod. atleast a hint such as changing extension to .html, such as:

    RewriteEngine On
    RewriteRule ^(.*)\.html$ $1.php [L]
    
    Code (markup):
    I hope it helps.
     
    Vooler, Feb 21, 2011 IP
  5. ka4ok85

    ka4ok85 Peon

    Messages:
    13
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Sorry for my question, but why do you really need this? I'm creating my own site and I made some research before, so looks like Google either .php either .html extensions.
    And anyone can figure out what language do you use...

    Thanks.
     
    ka4ok85, Feb 24, 2011 IP
  6. Alex Roxon

    Alex Roxon Active Member

    Messages:
    424
    Likes Received:
    11
    Best Answers:
    7
    Trophy Points:
    80
    #6
    RewriteEngine On
    RewriteRule ^([^.]+)[\/]{0,1}$ $1.php
    Code (markup):
    Would rewrite something like pages/test/page.php to pages/test/page
     
    Alex Roxon, Feb 24, 2011 IP
    flapjack_ likes this.