Show PHP files without .php in the URL
Want visitors to see www.voorbeeld.nl/contact instead of www.voorbeeld.nl/contact.php? You can set this up with an .htaccess file in the public_html folder:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [L]
The file is still called contact.php. If you work with .html files, replace .php with .html.
Detailed explanation with screenshots: Showing and editing hidden files such as .htaccess in the DirectAdmin guide.
Was this article helpful?
