I am rewriting all URLs and shorthand some of them:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(([^\.]+))\.pl [NC]
RewriteRule ^(.*)$ http://%1.pl%{REQUEST_URI} [R=301,L]
RewriteRule ^test$ test-page.php [R=301,L]
so that
example.pl/test
redirects to example.pl/test-page.php
but
example.pl/test/
redirects to example.pl/
while it should:
example.pl/test/
redirects to example.pl/test-page.php
How to handle both /url
and /url/
redirects?
I assume that it has to something with trailing slash.
Try this:
Tested here.