Non-www is working but www is giving 404

SYSTEM INFORMATION
OS type and version Ubuntu Linux 20.04.6
Virtualmin version 7.7-3

My domain (https://domain.com) is working perfectly fine but my client want www (https://www.domain.com), but the www is giving 404Not Found Error.

I have configured A-record for WWW, pointing the IP address same as non-www IP and still the www is showing 404NotFound error.

What can be possible error for this?

What happens if you ping domain.tld then www.domain.tld?

Assuming it is not a different site, and the DNS actually points to the correct IP, why not?

I thought Virtualmin created that record on creation of virtual server, did you delete it originally?

@ADDISON74 Here is ping screenshot.

Yes Stegan, I have already redirect all the request to the SSL Site.
Green Padlock is working non-www domain.

I deleted but I created and pointed with the same Host address.

A DNS lookup for that domain starts with 65. not 4 as does a lookup on DNS Checker so there is something odd going on with your DNS

Well if that IP dosen’t ping then you have a network issue

One thing I have figured it out is, I can access all the related links of the domain on www version of the website.
For Example - www.example.com/about [200OK - HTTP Response]

Except the Homepage, that’s the index file on www only i.e. 404 Not found

If the DNS records are accessible with ping, then the problem is in the webserver configuration. An alias is missing or you can create a rewrite condition.

If the domain in your post #4 above is the correct domain it is reachable as www.domain.com and domain.com in my browser (Chrome) but ping times out (which makes no sense) that domain is searchable by DNS Checker.

What is the website built on PHP ? WordPress / some other build tool, which webserver how is it proxied?

Domain.com is just an example of my domain and I haven’t used my original domain here.
I am just saying I am unable to access homepage(index.php) on www version of my website and the same homepage is easily accessible on non-www version of my website.

In my opinion, Virtualmin is the best panel that I have tested so far for virtual servers. With one condition, to be left alone and all the changes to be made in the interface. The moment everyone starts making their own changes, without keeping a tracking of them, problems start to occur. The ping timeout proves that there is a rule in the firewall for ICMP requests.

So the image you posted in post #4 is contrived ? you redacted only part of it leaving the pinged domain name visible and the start of the IP4.

Correct Stegan, But now the issue has been resolved it was some backend error from Laravel-PHP.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.