How to make www.site.com/file.php show up as www.site.com/file with PHP?

Discussion in 'PHP' started by JudeAustin, Nov 3, 2010.

  1. #1
    I completely forgot how to make urls show just the name of the file and not the extension.

    Can someone refresh my memory?
     
    JudeAustin, Nov 3, 2010 IP
  2. nicm0

    nicm0 Peon

    Messages:
    62
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    look for htaccess, RewriteRule, SEO frendly URLs, apache mod rewwite.
     
    nicm0, Nov 3, 2010 IP
  3. Richie_Ni

    Richie_Ni Illustrious Member

    Messages:
    10,721
    Likes Received:
    1,175
    Best Answers:
    0
    Trophy Points:
    410
    #3
    make a new folder named file and create a new php file index.php inside, put the source code in file.php to index.php.
     
    Richie_Ni, Nov 3, 2010 IP
  4. JudeAustin

    JudeAustin Active Member

    Messages:
    409
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    56
    #4
    Yeah, I thought about that.

    But wouldn't it affect the PHP?
     
    JudeAustin, Nov 5, 2010 IP
  5. bencummins

    bencummins Peon

    Messages:
    55
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    it would only affect it if it had includes and things, but you can just change the paths
     
    bencummins, Nov 6, 2010 IP
  6. Richie_Ni

    Richie_Ni Illustrious Member

    Messages:
    10,721
    Likes Received:
    1,175
    Best Answers:
    0
    Trophy Points:
    410
    #6
    I'm not sure if it does but I've always used it this way and never had any problems!
     
    Richie_Ni, Nov 6, 2010 IP