Latest news
Home » Server » .htaccess redirect not working apache

.htaccess redirect not working apache

1.Configure apache mod_rewrite,run in terminal

a2enmod rewrite

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

DocumentRoot /var/www
<Directory />
Options FollowSymLinks
 AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
3.Restart apache

/etc/init.d/apache2 restart

 

 

1.Configure apache mod_rewrite,run in terminal a2enmod rewrite 2. add the following code to /etc/apache2/sites-available/default DocumentRoot /var/www &lt;Directory /&gt; Options FollowSymLinks  AllowOverride All &lt;/Directory&gt; &lt;Directory /var/www/&gt; Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all &lt;/Directory&gt; 3.Restart apache /etc/init.d/apache2 restart &nbsp; &nbsp;

Review Overview

User Rating: Be the first one !

One comment

  1. I had added the “AllowOverride All” already, but I was missing the “Order allow,deny” and “Allow from all” parts… It works with them now. Thanks a lot.

Leave a Reply

x

Check Also

How can be list the installed SQL Server instances

Press window+R windows run window will open and then type cmd Command prompt will open ...