I'm having an issue with incoming URLs. I'm trying to remove trailing slash in every incoming request URL
I Searched and studied other posts and made consolidated rules for individual URL's in htaccess as follows
RewriteEngine on
Options +MultiViews
RewriteCond %{THE_REQUEST} \s/+WCOM/Flatsome/product-category/women/[\s?] [NC]
RewriteRule ^ /WCOM/Flatsome/product-category/women [L,R=301]
RewriteCond %{THE_REQUEST} \s/+WCOM/Flatsome/feed/[\s?] [NC]
RewriteRule ^ /WCOM/Flatsome/feed [L,R=301]
They are working fine, but for individual URL / Directory / sub Directory , I am looking for a generic solution which can accept any incoming request and remove slash in last segment.
Many post here are providing solution for specific URL ... Is there any generic way to do this?
Also, the following solution:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
is not pointing out right URL .. For example
http://localhost/WCOM//Flatsome/pages/about-us/
is pointing to http://localhost/about-us
Question
How can I rectify this URL issue?