Frage

I am using the following to remove the trailing slash:

 <VirtualHost *:80>


RewriteEngine On
RewriteRule ^(.*)/$ $1 [R=301,L]


</VirtualHost>

However, whenever I access my homepage (e.g. http://www.example.com/) I get a redirect loop

War es hilfreich?

Lösung

 <VirtualHost *:80>


RewriteEngine On
RewriteRule ^(.+)/$ $1 [R=301,L]


</VirtualHost>

Use + instead of *

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top