I have a website with html pages, and a single .php page. I am trying to figure out a way to hide the .php extension from address bar.
I would like the page to be displayed as example.com/submit, and not example.com/submit.php
Also, with the .htaccess file below, I can't seem to get a google site link to redirect from the .html version of the page to the .php page.
Here is what I have in my .htaccess file:
ErrorDocument 404 /page-not-found.html
ErrorDocument 403 /access-denied.html
SetEnv TZ America/Chicago
IndexIgnore *
Options +MultiViews
RewriteCond %{REQUEST_FILENAME} (.*)\.html [NC]
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %1\.php -f [NC]
RewriteRule ^(.*).html$ $1.php [NC]
I hope someone can help me get this working.
Thanks.
It appears this answer from another thread specific to godaddy works. Not even the accepted answer, but an additional comment.
Using .htaccess to make all .html pages to run as .php files?
Options +ExecCGI
AddType application/x-httpd-php .php .html
AddHandler x-httpd-php5 .php .html