user2871687
user2871687

Reputation: 21

How to: Getting SSL to work on Wordpress without 404 error

The problem is as follows:

I want to install a SSL certificate on my WP e-commerce WordPress website. I already installed the SSL via DirectAdmin. Besides many small tryouts, I have tried 2 main methods:

  1. Installed "Wordpress SSL" and forced the Admin panel into SSL encryption.> Via this method I was blocked out of the Admin panel and got a 404 error immediately after. When trying to access /wp-admin panel.
  2. Transfer all files in Public_HTML to Private_HTML and changed the website url in the WP admin panel from http to https://.> Via this method I can succesfully log in into the /wp-admin/ panel with SSL (https) ecryption. + all the pages worked when adding https:// to the URL. After adding a redirect via .HTACCESS I could also access all pages without adding https:// (thus via standard http://) in front of the url. Only problem was, all the images were gone.

Question. How can I get SSL to work (preferably only the admin panel) without loosing all images?

Upvotes: 2

Views: 1773

Answers (1)

Nick
Nick

Reputation: 31

I had the same problem as #1 on your list (404 errors when trying to access any URL on my website via https) and the solution for me was to add these lines to /etc/apache2/sites-enabled/default-ssl.conf, which is my SSL-enabled website's configuration file:

        <Directory /var/www/html/>
                AllowOverride All
        </Directory>

Of course, this assumes DocumentRoot /var/www/html. Change accordingly if is this is different in your setup.

The thing is that Wordpress uses .htaccess rules to process the URLs and for them to work, AllowOverride All needs to be in the server's configuration file.

In my situation, the configuration for the non-SSL and SSL-enabled variants were in a separate files. The non-SSL configuration had AllowOverride All all along, and so everything was working fine. Once I had enabled the SSL, the other configuration file came into play and didn't have the required AllowOverride All setting.

Upvotes: 1

Related Questions