The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

cPanel redirect tool is errant - redirect loop error

Discussion in 'General Discussion' started by jols, Jul 18, 2009.

  1. jols

    jols Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,111
    Likes Received:
    2
    Trophy Points:
    38
    This did not used to be the case. But now if you use the cPanel redirects tool to redirect traffic to a subdirectory you will get a redirect loop error.

    Here are the results of using the redirect tool that show up in the root web .htaccess file:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^.*$
    RewriteRule ^.*$ "http\:\/\/www\.domain\.com\/subdirectory\/" [R=301,L]


    To avoid the redirect loop error, I have to manually change the above to the following:

    RewriteEngine On
    RewriteCond %{HTTP_HOST}%{REQUEST_URI} ^domain.com/$ [NC,OR]
    RewriteCond %{HTTP_HOST}%{REQUEST_URI} ^www.domain.com/$ [NC]
    RewriteRule ^(.*)$ http://www.domain.com/subdirectory/$1 [r=301,nc]


    This of course leads to a number of unnecessary support calls throughout the week when our hosted customers try to do the redirect using the cPanel tool. Can anyone here suggest a resolution for a fix? Should I make a bug report or something like that? Or, is there a control or parameter file we can edit so that these redirects do not end up in loops?
     
  2. cesarlwh

    cesarlwh Well-Known Member

    Joined:
    Sep 23, 2008
    Messages:
    61
    Likes Received:
    0
    Trophy Points:
    6
    same problem on 4 servers
     
  3. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,481
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
Loading...

Share This Page