Jump to content

Hide .php extention


robert_gsfame

Recommended Posts

Assuming you have an apache webserver, you could use mod_rewrite to do something like this.

 

But on a different note, why would you want to? A few people have asked this sort of thing before because they felt it would add some sort of security -- it wont.

Link to comment
Share on other sites

This is done using a .htaccess file, not php.

 

http://corz.org/serv/tricks/htaccess.php

 

that's a pretty good resource.

 

The quick way to do what you want is using the following;

 

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^([a-z0-9-]+)$ $1.php [L]
RewriteRule ^([a-z0-9-]+)/$ $1.php [L]

 

That will push anything (as long as it only contains numbers, letters or dashes) to itself with a php extension

Link to comment
Share on other sites

please explain to me..how to create this file, where to put n why i have error message, it says "CGI problem"..Help...HELP ;D

 

How... Open a text editor, hit save as, call it .htaccess

 

Where... usually at your server root directory, if that's where you want it as well happy days!

 

Error Message... does this have anything to do with the topic at hand?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.