vusan
vusan

Reputation: 5331

.htaccess doesnot read by apache

My .htaccess file contains garbages value like

'dfdfsdfdsfdfdf'

Another file httpd.conf(/etc/apache2/httpd.conf) contains nothing

I expect at least .htaccess file to execute and display page as

internal server error

I also changed my code and change both file(.htaccess and httpd.conf) but the page index.php is displaying as if there is no both files(.htaccess and httpd.conf).

What is the cause?

Upvotes: 0

Views: 128

Answers (2)

vusan
vusan

Reputation: 5331

I made it to work by modifying /etc/apache2/sites-available/default
AllowOverride All on
Directory /var/www/ And Directory /

Upvotes: 0

Edward Ruchevits
Edward Ruchevits

Reputation: 6696

httpd.conf should contain AllowOverride All for document root directory.

DocumentRoot "D:/Projects/Example/htdocs"
<Directory "D:/Projects/Example/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

Otherwise, usage of .htaccess files is disabled.

Upvotes: 6

Related Questions