apache2 doesn't see it.htaccess
The problem is widespread, first I climbed a bunch of manuals and tried different options, in the end it did not go. Now I'm writing. Just delving into linux. put apach2 there shoved mod_rewrite, created a virtual host (threw there a project on yii2 with openservera)
<Directory />
AllowOverride All
</Directory>
In the Apache settings, namely here /etc/apache2/apache2. conf
, the following is written: AccessFileName .htaccess
The virtual host is loaded - there are no problems with this , but the file .htaccess does not see point-blank. I note that there are no errors in the syntax of the project itself, because a working project with win OpenServer is taken.
And an additional question apache and apache2, the difference in versions?
Tell me what to do with it?
Maybe I didn't install any mods?
3 answers
I solved the problem, maybe someone will have the same one. in these manuals it is written with an error. I'll leave it here.
In order to see the file .htaccess
, you need to register in addition to the virtual host settings in the apache config
/etc/apache2/apache2.conf
:
AccessFileName .htaccess
And this:
<Directory /var/www/>
Options Includes Indexes FollowSymLinks
AllowOverride All
</Directory>
Often the rewrite module is disabled (in ubuntu and debian, this is the default). Enable a2enmod rewrite
AllowOverride All
/etc/httpd/conf/httpd.conf In the section responsible for the directory, just
(checked on httpd+CentOS)