I have a website where there are many directories like test so when I open my website with domain.com/test it gives me domain.com/test/ I want this last slash to be removed.
I also want to remove the extention so that when I open a page like page.php
it gives me domain.com/page
In addition, I want to send all the error pages to domain.com/error404
and I do have added code for non http to https
This is my current attempt:
RewriteEngine On
RewriteBase /
Options All -Indexes
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.domain.com/$1 [R,L]
ErrorDocument 403 /www.domain.com/error404.php
ErrorDocument 404 /https://www.domain.com/error404.php
https is working correctly but I also want to remove the last slash and extensions and handle error pages which currently do not work.