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.

Redirect Issue

Discussion in 'Bind / DNS / Nameserver Issues' started by BottyZ, Oct 17, 2016.

Tags:
  1. BottyZ

    BottyZ Member

    Joined:
    Jul 31, 2015
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Nottingham UK
    cPanel Access Level:
    Root Administrator
    Hi all,

    I'm writing on here in the hope someone may be able to point me to a setting that I'm missing. I've just noticed a problem with a redirect loop that only occurs when typing domain.com, in either chrome or opera browsers. Note: I've only tried this on IE, Firefox, Chrome & Opera.

    The issue is that when domain.com (or domain.com/) is typed into the address bar the browser will display a 404 page, and changes the address to domain.com//www.domain.com/www.domain.com/www.domain.com/www.domain.com/ ...repeatedly.

    If I type any other combination such as www.domain.com or domain.com/index.php, I don't have any issues with the appropriate page loading.

    I've following a number of links through google searches on the issue to tutorials about clearing browser cookies, etc... all to no avail. And I've tried it on several computers around the office here, after installing chrome and opera for the first time.

    With regards to my website, I don't have any redirects or anything set in my index.php file. And it's mostly html, bar the inclusion of a common website navigation menu .php file.

    If I include the following .htaccess file to redirect non www to www, it displays the same as the above but with the beginning being www.domain.com/www.domain.com ...repeatedly.

    Code:
    <ifModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L,NC]
    </IfModule>
    
    DirectoryIndex index.php index.html
    
    ErrorDocument 400 /400.php
    ErrorDocument 401 /401.php
    ErrorDocument 403 /403.php
    ErrorDocument 404 /404.php
    ErrorDocument 406 /406.php
    ErrorDocument 500 /500.php
    So with, or without a .htaccess file, typing domain.com (or domain.com/) into the browser sends it into the loop with chrome and opera.

    Now I know you might automatically think, it's not a cpanel / apache issue, but I'm not so sure (hence why i'm asking here). What makes me unsure is the fact that I've tried removing all .htaccess files and also included .htaccess file such as the one mentioned above, all with very similar results. I think it may be something to do with a possible setting or setup of my cpanel vps.

    If anyone could offer any suggestions, I would appreciate the help.
     
  2. BottyZ

    BottyZ Member

    Joined:
    Jul 31, 2015
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Nottingham UK
    cPanel Access Level:
    Root Administrator
    Strange, I didn't post this thread in this part of the forum, has it been moved here by an admin?
     
  3. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,472
    Likes Received:
    201
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Yes, this isn't an Apache issue. That is to say unless you've modified your Apache templates?

    Are you using a script of some sort (like wordpress) for this website?
     
Loading...

Share This Page