Tag Archives: PHP

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”

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.

File Caching

We can cache the file using htaccess so that we can improve
the perfomace of a website

General Format

<FilesMatch “.(Extenstion of the file to be cached)$”>
	Header set Cache-Control “max-age=cache time″
</FilesMatch>

Example

<FilesMatch “.(html|htm)$”>
	Header set Cache-Control “max-age=43200″
</FilesMatch