Skip to content
Advertisement

Web resources in subfolders not loading on domain but work fine with the IP address

I have hosted a website using PHP and MySQL on ubuntu. It worked well but somehow suddenly, web resources are not loading when the URL includes the domain but do load when the URL contains the IP address.

eg. mywebsite.com is working fine but mywebsite.com/anything is not XXX.XX.XX/anything is working just fine.

Please help me in finding the source of the problem. I checked the subfolders, all files are present there.

Apache.conf file: enter image description here

Conf file in sites available:

<VirtualHost *:80>
        ServerName mywebsite.org
        ServerAlias www.mywebsite.org
        DocumentRoot /var/www/html

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Error logs: Server Log: HTTP: failed to make connection to backend Browser o: Failed to load resource: the server responded with a status of 404 (Not Found)

Advertisement

Answer

There was an issue with the domain name. the URL was being redirected to the wrong IP

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement