Connect rewrite module to apache.conf ; In htaccess inserted this code

 RewriteEngine on RewriteBase / RewriteRule ^(.*)$ index.php 

Apache is installed on Windows.

On index.php does not redirect, what could be the problem?

    2 answers 2

    For the mod_rewrite module to work correctly, your server must support the use of .htaccess files. Enable support in the apacha config (it is disabled by default). apache2.conf

    Here, the standard description of the directive:

     <Directory "/usr/local/www/phpMyAdmin"> Options FollowSymLinks AllowOverride None Order Deny,Allow Allow from all </Directory> 

    The key line here is AllowOverride None. In order for your .htaccess to work, change the word None to All. In other words, the directory takes the following form:

     <Directory "/usr/local/www/phpMyAdmin"> Options FollowSymLinks AllowOverride All Order Deny,Allow Allow from all </Directory> 

    (note! the .htaccess file name starts with a dot!)

    • I tried, not redirect ( - justness
    • @justness and what virtual server do you use? - sashatexb
    • @justness for the mod_rewrite module to work correctly, your server must support the use of .htaccess files. - sashatexb
    • I cleanly downloaded a new Apache and installed - justness
    • @justness apache what version? - sashatexb

    Maybe someone will help ... I spent a day with htaccess. Changed settings in httpd.conf, etc. nothing helped. It turned out that it was trite to save the file through a text editor, such as Nopadpad ++ (through which it was saved). And initially created through the usual Notepad

    • And what was the snag with a notebook? This is also a technical editor, although not digestible. Maybe someone will help, but I do not think that the author of this issue. - 0xdb