Wordpress SSL 404 and redirect

3.4k Views Asked by At

I'm running WP 3.8 for a client site on an Apache server. I have installed an SSL cert that my client purchased from GoDaddy. I am able to verify that the SSL is installed properly, by creating a test php page in the root directory and visiting it on https. It works.

The problem is, no pages inside Wordpress work with SSL. Visiting the homepage - https://assembliesofyahweh.com - redirects to the host's homepage. Visiting any other pages, such as https://assembliesofyahweh.com/contact, result in a 404.

All I need SSL for is the login page. When I add the following:

define('FORCE_SSL_LOGIN', true);

to my wp-config file, the login page itself doesn't redirect to https. Instead, visiting the wp-admin page redirects to the https login page and results in a 404.

I have mod_rewrite installed and enabled, and Apache is configured to AllowOverride. I've looked everywhere, but I haven't found a problem that fits mine. What on Earth am I doing wrong?

2

There are 2 best solutions below

7
On

You need to implement it on wp side. You can use Wordpress HTTPs plugin for this .After install this plugin,

enter image description here

For some cases, you may need to use ssl on your custom pages(donate page, checkout page, etc). In such cases, you can enable ssl on page edit section like below;

enter image description here.

If you couldn't make it work, please double check your WordPress Address (URL) from admin panel Settings > General. Give your https domain there;

enter image description here

Now, you can use your page in https

0
On

I had exactly the same problem (404 errors when accessing 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.