i am trying to set my webpage in apache2.
When i try to open a .html file throu the browser line (example: https://example.com/index.html) it only shows the standart 404 Page of Apache2
my site config:
/etc/apache2/sites-aviable/000-default.conf
ServerName example.com
ServerAdmin [email protected]
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<IfModule mod_dir.c>
DirectoryIndex index.html index.php
</IfModule>
RewriteEngine on
RewriteCond %{SERVER_NAME} =example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
```
And the Structure of the /var/www/html Folder:
html
|favicon.ico
|index.html
|othersite.html
|background.png
|style.css
And if i try to oopen the index.html directly the error 404 also comes.
It should open the correct .html file but it only shows the 404 Page :"Not Found
The requested URL was not found on this server.
Apache/2.4.55 (Ubuntu) Server at example.com Port 443"
Thanks for help
New contributor
TheJoJo334 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.