I have my Apache server all setup with a domain pointing to its IP address. When I go to the domain it serves me the "It Works!" page. I have another page in the /var/www/html
directory called page.html
. However, when I type in www.mydomain.com/page.html
is gives me a 404 Not Found error. And when I type www.mydomain.com/index.html
, it brings me right to the index page which is the "it works!" one. I have no idea whats going on and I've been scouring the internet in search of an answer and I have come back empty-handed. My domain provider is Ipage if that is any help.
1 Answer
Try enabling mod_rewrite with sudo a2enmod rewrite
.
You can also try checking any config files in /etc/apache2/sites-enabled
and ensuring that AllowOverride
is set to All
and not none
.
After either or both is done, restart Apache with sudo service apache2 restart
.
-
Can you explain how this could help, especially without any rewrite rules?– MelebiusApr 19, 2018 at 7:55
-
@Melebius without mod_rewrite or allowing overrides your server may not be able to correctly serve files due to (most likely) not recognizing the connection between domain name and folder location.– zbeeApr 26, 2018 at 21:46
index.html
page present in the same directory as yourpage.html
? Could you check they both have correct permissions (ls -l
)?