I have a working website on a free shared server. I decided to hire a dedicated server and purchase a domain for my website. I started uploading the files but things aren't working the way they should. First of all .htaccess is not working, however I set AllowOverride from None to All in /etc/apache2/sites-available/default

DocumentRoot /var/www
<Directory />
   Options FollowSymLinks
   AllowOverride None
<Directory /var/www/>
   Options Indexes FollowSymLinks MultiViews
   AllowOverride All
   Order allow,deny
   allow from all

I restarted the server of course. I enabled mod_rewrite:

a2enmod rewrite

and restarted the server.

This change causes a 403 forbidden access error which I am unable to work out. If I change the All back to None then .htaccess is ignored so instead of loading the website the file hierarchy is loaded (the main page is index4.php which should be opened by .htaccess). If I rename index4.php to index.php the website loads, just fyi.

The permissions on the file is 600. If I change it to 444 I get 500 Internal Server Error.

I checked the logs and I see many errors of this: Permission denied: file permissions deny server access: /var/www/index.html


Usually, 403 error caused by wrong permission. The proper permission under /var/www/ is 755 for folders and 644 for files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.