Hiding PHP extension in browser address

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • codexxx
    New Member
    • Jun 2007
    • 18

    Hiding PHP extension in browser address

    Hi,all

    I wanted to make a system so that in the browser php extension cant be seen. Though I have been able to make it by editing the .htaccess file but I want it such a way that if anyone type the php as extension then it would take him to an error page.
    Please help me by giving a .htaccess file where that code is written or give me any useful link. Its very urgent so if you can help quickly then it would help me gain some respect.
    Send via Private Mail at this site.
    \[email address removed] Thank you all...

    Regards
    codexxx
    Last edited by ronverdonk; May 23 '08, 01:33 PM. Reason: email address removed
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Originally posted by codexxx
    Hi,all

    I wanted to make a system so that in the browser php extension cant be seen. Though I have been able to make it by editing the .htaccess file but I want it such a way that if anyone type the php as extension then it would take him to an error page.
    Please help me by giving a .htaccess file where that code is written or give me any useful link. Its very urgent so if you can help quickly then it would help me gain some respect.
    Send via Private Mail at this site.
    \[email address removed] Thank you all...

    Regards
    codexxx
    Such requests, which in all honesty sound like demands, are ignored by myself.

    Ask in a considerate way and you may get somewhere.

    Regards.

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      You can configure your Apache server to execute custom extensions as PHP files, so if you were to configure it to execute, for example, .cgi files as PHP, then you could change the .php files to .cgi.
      If they are then called as .php, they would return the standard 404 error.

      Would that work?

      Originally posted by codexxx
      Send via Private Mail at this site.
      This community is based upon sharing information with everybody. Not just the OP.
      Because of that, we won't PM or email solutions, but rather post them here in the forums where everybody can benefit from them.

      P.S. Posting your email address in the forums is forbidden by the Posting Guidelines, which everybody should have read before posting here.

      Comment

      Working...