I have VPS running ubuntu 12.04. I have apache2 installed and it serves web pages from a virtual host without any problems. Now I need to include the .htaccess file, but I cannot get it to work.
the .htaccess file is in the same directory as the index.php file that apache shows. I added garbage data to the .htaccess file, so when I earn it, it should show 500 Internal Server Error.
I edited the file / etc / apache 2 / sites-available / default and installed AllowOveride in All in the / var / www directory and restarted apache using sudo service apache2 restart
From what I read, this should be enough to get the .htaccess file for processing. When I visit my webpage, however, I do not see 500 Internal Server Error, but the contents of the index.php file, so it seems that the .htaccess file is not used.
Here is my file / etc / apache 2 / sites-available / default
<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> </VirtualHost>
file / etc / apache2 / apache2.conf
#
Any suggestions?
source share