I want my website to look, for example www.example.com/about/
However currently I have a htaccess code which removes the .php and .html extensions
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
The above code makes my url look like, for example www.example.com/about It does not have the ending forward slash (trailing slash) as I don't know the htaccess code.
Can someone please give the code to add the forward slash(trailing slash) at the end of the url as the codes I found in the many other post doesn't work for me.
Also please take note, for the htaccess code which I have above, I had to change my links without its extension. eg; a href="index" instead of a href="index.html"
So to summarize
1.) What is the code for htaccess to make my url end with a forward slash (trailing slash) without the extension. eg; www.example.com/about/
2.) Currently, my links are set without its extension to make my current htaccess code. (eg; a href="index" instead of a href="index.html") So do I have to change it back with its extension?
3.) I need a code that works for both php and html
4.) Should I change all the links that links back to my index page as the domain name so that when someone clicks the Home link from another page from my website, it will appear as , for example eg; wwww.example.com instead of www.example.com/index
Thank you so much for taking the time to read, hoping for an answer as well as an explanation to the code.