user434885 user434885 - 1 year ago 82
PHP Question

editing the url on website

i have a php website running, i want to remove the .php postfix from all of my webpages so that he user doesnt get to know what server side language is running. how do i edit the displayed address in the adress bar to not show the .php ?

Answer Source

With mod_rewrite in .htaccess:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L] 
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download