How to hide the extension in url in PHP
Printable View
How to hide the extension in url in PHP
put the following lines in your .htaccess file
Code:RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)$ /$1.php [L,QSA]
I am using wampserver 2.2.Where I have to post the thing.I didn't get it.
:) you need to study some basics about .htaccess, it is a file used to configure Apache Server on individual directory basis.
to make it simple: create a new file with notepad or any favorite editor, paste the above text in, save it as ".htaccess" in the folder you want to hide PHP extensions in (if it does not exist).
also make sure you turn on rewrite_module; click on WAMP icon in notification area. Apache>Apache Modules>rewrite_module