Hide PHP file extension

You can hide the php file extension using .htaccess so that you can confuse the spammers and hackers .

You can use “asp” file to work as a “php” file ie use the extension “asp” for yourr file instead of “php”.

You jsut need to cerate a .htaccess file and ad the code shown below

# Make PHP code look like asp or perl code
AddType application/x-httpd-php .asp

After this create file “comment.asp” and with php codes in it.

Then load the page “comment.asp”

Benefits and drawbacks – Rewrite engine

  • The links are “cleaner” and more descriptive, improving their “friendliness” to both users and search engines.
  • They prevent undesired “inline linking”, which can waste bandwidth.
  • They hide the inner workings of a web site’s address to visitors, which can prevent them from discovering query strings that could compromise the site.
  • The site can continue to use the same URLs even if the underlying technology used to serve them is changed (for example, switching to a new blogging engine).
  • There can, however be drawbacks as well; if a user wants to modify a URL to retrieve new data, the rewrite engine may hinder the construction of custom queries due to the lack of named variables.

Rewrite engine

A rewrite engine is software that modifies a web URL’s appearance (URL rewriting). Rewritten URLs (sometimes known as short, fancy URLs, or search engine friendly – SEF) are used to provide shorter and more relevant-looking links to web pages. The technique adds a degree of separation between the files used to generate a web page and the URL that is presented to the World.