Basically I have the following code:
Code:
#Add Trailing Slash to all URLS
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !\.[a-zA-Z0-9]+$
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !/$ %{REQUEST_URI}/ [L,QSA,R=301]
#Strip index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/ !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
With the objective to do 2 things:
- If the page request is a URL without a trailing slash add one: http://localhost/parameter/parameter2 becomes http://localhost/parameter/parameter2/
- Remove Index.php from the URL
I am not sure which part of the code is triggering the error but basically it half works:
http://localhost/folder/secondparameter -> WORKS!
If there is a single parameter to the URL it seems to fail the redirect, to be exact it redirects to the following URL:
http://localhost/folder becomes ->
http://localhost/E:/Informations/My%...s/base/folder/
Which is way off the rader and I'm unsure why it is redirecting in this way, as soon as I add a second URL parameter or a trailing slash it works as expected?