Question

More WordPress permalink tomfoolery - this time on a https install:(

Hi,

I have a Wordpress site running on Ubuntu 16.04 installed using Digital Oceans wonderful 1-click install - I even have multiple domains redirecting to one primary parent domain! Not bad for a rookie! I then got some confidence and upgraded my site to https using LetsEncrypt also thanks to the useful guides available from DO. Rookie confidence increasing!

Yesterday I purchased a premium theme, installed it and moved the permalink structure to ‘post name’ and all hell broke lose as any permalinks on the homepage to my site no longer work (they now get a The requested URL <subURL> was not found on this server.).

I recognize this is something this is something that catches out a number of people so have tried various DO articles on the matter to no avail. Fixes attempted include:

  • updating permissions of the main .htaccess from 664 to 666 using chmod.
  • making sure is a2enmod is running using: a2enmod rewrite - it is.
  • Updating /etc/apache2/sites-enabled/000-default.conf to AllowOverride (it now has the following in it:
    <Directory /var/www/html/> Options FollowSymLinks AllowOverride All Order allow,deny allow from all Require all granted </Directory>
  • Updating /etc/apache2/sites-enabled/default-ssl.conf to AllowOverride - if I try and put the same text as added in 000-default.conf the site failts to load and delivers an ‘ERR TOO MANY REDIRECTS’ message.
  • Updating /etc/apache2/sites-enabled/apache2.conf to AllowOverride - as soon as I restart Apache2, the site fails to load and delivers an ‘ERR TOO MANY REDIRECTS’ message.

Rookie confidence draining, any expertise thrown my way would be much-appreciated Team DO:) The most re-booted site in the world today is available at www.wealth-hack.com

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

@jtittle the plot thickens, another conf file to consider!

Ok, in my /.sites-available dir, I have two ssl type files, default-ssl.conf (which I knew about and mentioned in the first post above) and default-ssl.conf.save which I haven’t spotted before.

default-ssl.conf.save has very similar to what you stated above

<IfModule mod_ssl.c>
        <VirtualHost _default_:443>
                ServerAdmin james@wealth-hack.com
                ServerName wealth-hack.com
                ServerAlias www.wealth-hack.com
                DocumentRoot /var/www/html

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

                ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined
                SSLCertificateFile      /etc/letsencrypt/live/wealth-hack.com/fullchain.pem
                SSLCertificateKeyFile /etc/letsencrypt/live/wealth-hack.com/privkey.pem

There is a lot more text but almost all of it is commented out. I don’t have the Include /etc/letsencrypt/options-ssl-apache.conf within the file however.

default-ssl.conf is the same (no Include /etc/letsencrypt/options-ssl-apache.conf) but it also doesn’t have the following:

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

Breaking news, I think that was it! I added the config just referred to into default-ssl.conf and the post name permalinked URL’s are now functioning!!:) I’ll get back onto my find and replace to get secure back and I’ll be fully working once again:):):)

So many thanks to @jtittle @hansen and @sierracircle for guiding me through this. Hopefully, the documentation chain above was good enough for other newbies like me to help them in the future. Loving being part of the DO community, will keep working hard and one day, I might be able to help others:)

Hi @hansen - consider it de-activated. The site will look a bit goofier now but good to keep this as simple as we can to get it working. For info, I did search and replace + better search and replace before turning to SSL Insecure Content Fixer, didn’t seem to work for me then. I’ll hold of re-running just now as the dry run indicates the premium theme I purchased and installed has 1000+ http:// to convert to https://, don’t want to change too much at the same time (unless we think this is related).

@hansen + @sierracircle, also done, the site has no SSL type plugins running and is set to ‘post name’ (with a double save just incase)!:)

@jamesburns77

A file called 000-default-le-ssl.conf should have been created when LE ran, which would physically be located in ./sites-available and symlinked to ./sites-enabled.

That file should look like:

<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ServerName domain.com
        ServerAlias www.domain.com

        <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
        SSLCertificateFile /etc/letsencrypt/live/domain.com/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/domain.com/privkey.pem
        Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

If you don’t have that file, or are using another file, the configuration should look identical to the one I posted above. That’s verbatim from my one-click.