I've been trying to remove ".php" from all of the pages on my website, whilst also removing all trailing slashes and "www" from URLs using .htaccess. I have been able to use one or two of these at the same time, but not all. I would really appreciate any help.
For example:
- example.com/ to example.com
- www.example.com to example.com
- example.com/index to example.com
- example.com/index.php to example.com
- example.com/chatroom.php to example.com/chatroom
- example.com/directory/ to example.com/directory
I would like to ensure that the old URLs redirects to the new ones, and I don't have any directories that share names with PHP files. In my .htaccess file I also have code blocking particular referrers and specifying 403 and 404 errors. Thank you very much!