Answer the question
In order to leave comments, you need to log in
How to get rid of looping in RewriteRule?
Two virtual domains look at one htdocs. At the root of the hosting, I created directories for them htdocs/forum
and htdocs/media
. Next to them is this htaccess:
RewriteEngine on
RewriteCond %{HTTP_HOST} =forum.cantorsys.com [NC]
RewriteRule ^ /forum%{REQUEST_URI} [QSA,L]
RewriteCond %{HTTP_HOST} =media.cantorsys.com [NC]
RewriteRule ^ /media%{REQUEST_URI} [QSA,L]
#RewriteRule ^/(.*)/?(.*)? http://$1.cantorsys.com/$2 [QSA,R=301]
http://forum.cantorsys.com/forum/userlist.php
redirected to http://forum.cantorsys.com/userlist.php
, that is, to be removed /forum
from the path and the new path to be in the address bar of the browser.http://media.cantorsys.com/forum/userlist.php
it redirects normally, but http://forum.cantorsys.com/forum
causes a loop.Answer the question
In order to leave comments, you need to log in
RewriteCond %{REQUEST_URI} ^/forum/(.*)$ [QSA,L,NC]
RewriteRule ^(.*)$ http:/forum.cantorsys.com/%1 [R=301,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question