0

I have a DigitalOcean server with Apache2 installed, which runs virtual hosts.

I have set up the site in a sub-folder var/www/html/[site-name]. The URL being something like 192.168.1.8/[site-name]/.

All was working well until I created a virtual hosts .conf file and pointed a domain to the server.

The home page loads, but non of the subpages. If reset the permalinks to default, they load fine like 192.168.1.8?p=123.

Normally the problem would either be AllowOverride All not set, a2enmod rewrite not on, or the .htaccess file is not there or doesn't have the correct permissions.

I've never seen this problem before! Do you know what may be up?

2

Even though the 000-default.conf file had...

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        <Directory /var/www/html/>
            Options FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

I had to place...

<Directory /var/www/html/>
    Options FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

Into the apache2.conf

And use the sudo service apache2 restart command.

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.