Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k points)

I have a server from AWS EC2 service running on Linux Ubuntu and I have installed Apache, PHP, and MySQL.

I have added a .htaccess file in my document root /var/www/html.

I entered this code in it:  ErrorDocument 404 /var/www/html/404.php and it is still not showing up.

I kept entered this command multiple times: sudo service httpd restart to restart the server but no changes displayed...

How to fix this?

1 Answer

0 votes
by (44.4k points)

Enable Apache mod_rewrite module

a2enmod rewrite

add the following code to /etc/apache2/sites-available/default

AllowOverride All

Then Restart Apache2

/etc/init.d/apache2 restart

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer

Browse Categories

...