Redirect Issue
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.
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.
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L,NC]
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.phpSo 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.
-
Strange, I didn't post this thread in this part of the forum, has it been moved here by an admin? 0 -
Yes, this isn't an Apache issue. That is to say unless you've modified your Apache templates? 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.
Are you using a script of some sort (like wordpress) for this website?0
Please sign in to leave a comment.
Comments
2 comments