Currently, when a request is made for a URL that is not a directory, my .htaccess is set up to remove any trailing slash. The problem is, that is causing test.domain.com/order.php/ to be redirected to test.domain.com/test/order.php instead of test.domain.com/order.php. It works perfectly when not in a subdomain.
Here is the .htaccess code I am using to remove trailing slashes:
#if it's not a directory
RewriteCond %{REQUEST_FILENAME} !-d
#and it has a trailing slash, then redirect to URL without slash
RewriteRule ^(.+)/$ /$1 [L,R=301]
Somehow, the subdirectory the subdomain serves from is being added to the URL in addition to the subdomain already there. How can I remove the trailing slash without adding /test?
Edit:
Here is the full .htaccess:
RewriteEngine On
Options +SymLinksIfOwnerMatch
Options -Indexes
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ /$1 [L,R=301]