Redirection problem to http://mydomaine.com/cgi-sys/defaultwebpage.cgi

Operating System & Version
centos7
cPanel & WHM Version
96.0.11

prettyallo

Registered
Jul 11, 2021
4
0
1
Belgique
cPanel Access Level
Website Owner
Hello everyone.
I am new to cpanel. But I never had any problem until now.

When you want to access my site, it redirects to the page http://mydomaine.com/cgi-sys/defaultwebpage.cgi

###### Situation #####
- I reinstalled my site two weeks ago.
- I use magneto 2.4.2 .
- I installed magento with 'softaculous App installer', without any problem.

- When I want to access my site with my machine, I have no problem, I normally access the site from my machine. Even from a virtual machine installed on my physical machine, I can access my site.

###### Problem : ######
My site is only accessible from my machine. When another person wants to connect to my site, he is redirected to the page http://mydomaine.com/cgi-sys/defaultwebpage.cgi


Before posting this problem, I tried a lot of solutions, but so far nothing works for me

1- I had first to modify the file
Bash:
 /usr/local/cpanel/htdocs/index.html
:

HTML:
<html><head><META HTTP-EQUIV="refresh" CONTENT="0;URL=/cgi-sys/defaultwebpage.cgi"></head><body></body></html>
And replace with :

HTML:
<html><head><META HTTP-EQUIV="refresh" CONTENT="0;URL=https://mydomaine.com"></head><body></body></html>
But, nothing. This solution didn't work: it affected the browser in an infinite loop.


2- afterwards, in
Bash:
 /etc/apache2/conf/httpd.conf
, I added a VirtualHost

HTML:
<VirtualHost my_ip_adresse:80>
ServerName my_domaine.com
ServerAlias www.my_domaine.com
DocumentRoot /home/User_name/public_html
</VirtualHost>.
But nothing, not solved the problem. So I deleted it, not to put the **** in this file unnecessarily.

3 - Empty the cache of my browser or of the secondary machine with which I do my tests.

Nothing to do, it always redirects to http://mydomaine.com/cgi-sys/defaultwebpage.cgi

4- and finally the solution that worked partially.
I read somewhere that this was due to the DNS record. That it was necessary to have clean DNS records.
OK, in fact I had only two errors in my DNS records (at the MX level), but my site was working without any problem with Magento 2.3. so it never bothered me.
But it's not a problem, last night I corrected these MX record errors in my DNS.
Waited for a few moments for it to propagate and a few hours later a friend of mine tried to connect to my site and everything was working fine, he was no longer redirected to the http://mydomaine.com/cgi-sys/defaultwebpage.cgi page.
All seemed to be good, until this morning when my friend told me that he was redirected to the /cgi-sys/defaultwebpage.cgi page again. I haven't changed anything since last night.

So I'm a bit confused, and I don't know what to do anymore. Because when I search for the solution to this problem in Google. It's always the same answers that come back, and I've already tried them all.

*NOTE 1:
I can connect to my site from my machine without any problem. But when the others connect, it redirects them to http://mydomaine.com/cgi-sys/defaultwebpage.cgi .

*NOTE 2:
People can access my site through a proxy.
When they type My_domain.com on KPROXY - Free Anonymous Web Proxy - Anonymous Proxy for example, it goes through without problem.

*NOTE 3:
When I check my DNS records on intoDNS: checks DNS and mail servers health . it doesn't detect any error . all is OK

######## USEFUL INFORMATION ########
* WHM /Cpanel = version 96.0.11
* magennto 2.4.2-p1

**** contents of the .htaccess file ******

Code:
SetEnv MAGE_MODE developer
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !^/pub/
RewriteCond %{REQUEST_URI} !^/setup/
RewriteCond %{REQUEST_URI} !^/update/
RewriteCond %{REQUEST_URI} !^/dev/
RewriteRule .* /pub/$0 [L]
DirectoryIndex index.php

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php74” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,505
2,605
363
cPanel Access Level
Root Administrator
Hey there! You definitely don't want to edit the /usr/local/cpanel/htdocs/index.html file or the Apache configuration directly as that will likely just lead to other issues.

It sounds like you were on the right track with the DNS change. This issue is almost always caused by a mismatch between the DNS record for the domain and the IP address the domain is configured to use in Apache. What you are seeing at this time is likely DNS propagation, especially if you don't see anything odd from IntoDNS.

Since it has been almost 24 hours since you posted this, are you still seeing problems with the site?
 

prettyallo

Registered
Jul 11, 2021
4
0
1
Belgique
cPanel Access Level
Website Owner
Hey there! You definitely don't want to edit the /usr/local/cpanel/htdocs/index.html file or the Apache configuration directly as that will likely just lead to other issues.

It sounds like you were on the right track with the DNS change. This issue is almost always caused by a mismatch between the DNS record for the domain and the IP address the domain is configured to use in Apache. What you are seeing at this time is likely DNS propagation, especially if you don't see anything odd from IntoDNS.

Since it has been almost 24 hours since you posted this, are you still seeing problems with the site?


Hi Jurassic Moderator

Yes, it was a DNS problem.
But not directly to the registrations.
The problem was related to IPv6.
My domain mydomai.com resolves to an IPv6 and IPv4 address, but had not been configured with IPv6 on my server (only with IPv4).
As a result, visiting computers with IPv6 available were not able to load the correct site.
That's why the page was redirecting to the default website page from some locations, but other locations were loading the site without problems without redirection.

To correct the problem I had to add the IPv6 address of my server
(provided by my host. Or you can also get it with the command
Bash:
$ dig AAAA mydomain.com +short
)
to my server via WHM -> IPv6 Ranges.
I then assigned this range to the main account via WHM -> Assign IPv6 Address.

My site now loads from every location, if IPv6 is available on the visiting machine or not.

Thank you.
Problem solved :cool:


Ps: credit to cpanel technical support, who provided me with the solution and at the same time the explanation to this problem :);)
 
Last edited by a moderator: