Ammar Hayder Khan
Ammar Hayder Khan

Reputation: 1335

.htaccess is not working apache

I have a server from amazon's ec2 service running on linux ubuntu and I have installed apache, php, mysql and codeigniter2. I have installed the codeigniter in /var/www/html/CI/ .I have added a .htaccess file in my document root /var/www/html/CI. I entered this code in it: ErrorDocument 400 /var/www/html/404.php and it is still not showing up.

Upvotes: 1

Views: 1565

Answers (1)

zx81
zx81

Reputation: 41838

.htaccess is turned off by default

Directives in .htaccess files can override the settings in the main Apache configuration file, but by default that feature is turned off. To use htaccess, it needs to be turned on in the main Apache configuration file.

If you are managing your own server, open httpd.conf and make sure that the webroot directory block contains one of these lines: AllowOverride FileInfo or AllowOverride All

Upvotes: 3

Related Questions