Hi,
I am building a small website, using basic PHP and HTML.
I coded and developed the website on a local WAMP server, on my laptop.
Just recently, I purchased a domain, and deployed my website there.
Everything works fine...........except for the .htaccess file.
I want to remove file extensions from my file names, so that they don't display in the web browser.
There are sooooo many online tutorials which address this issue. So, I assumed that it would be an easy thing to solve.
However, I seem to be doing something wrong, because my .htaccess file is not working.
(Maybe, my code structure in the file is wrong? But, I wrote the file based on dozens of other examples online)
My website contains many files with both HTML and PHP extensions.
Apparently, it is not possible to construct a htaccess file that removes extensions for BOTH these file-types
So, I simply renamed all my HTML files to PHP (replaced the html extensions with php.
And, then, I wrote the code for removing PHP extensions.
Here is my HTACCESS file :
# disable directory browsing
Options -Indexes
# enable Multiviews
Options -MultiViews
# allow server to process and follow all "fictional" URLs.
Options +FollowSymlinks
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/$ $1.php [NC,L]
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php
</IfModule>
# END WordPress
This seems correct in every way.
So, why is it not working?
(a) My domain is hosted on a shared server, so there is no need to configure any HTTPD.CONF files
( Mod_Rewrite is enabled by default;