2
votes

I am using WordPress 4.9.2 and have followed all the steps for installation.

Now, once the installation finished I tried to login using entered credentials.

But its redirecting me to same wp-login.php page again and again. I tried 'Lost your password?' option but haven't received any email yet.

Also, since my website uses SSL, I entered 'siteurl' and 'home' values with 'https://example.com/blog' but it doesn't even load wp-login.php then and as soon as I change it to 'http://example.com/blog' it loads the login page but after submission get redirected to same page.

Below are the few things I tried to get it resolved.

  1. added below code in wp-config.php

    define('FORCE_SSL_ADMIN', true);
    
  2. disabled all plugins by renaming plugin folder

  3. removed .htaccess file

  4. restored default .htaccess file

  5. added below code in wp-config.php

    if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') 
      $_SERVER['HTTPS']='on'; 
    
  6. changed wp-login.php permission to 644

After every change , have cleared cache, cookies and checked again but no success.

3
Do you have access to your Apache / nginx config? - Mason Stedman
No. But you can suggest options so that I can communicate with the concerned person - Vrushali
1. Is site serving front end pages e.g. home page by either a) HTTP, or b) HTTPS successfully? 2. Is the SSL cert installed on your server? 3. If not then who/what is providing SSL cert/ "HTTPS access"? - scytale
1. front page is loading properly with https 2.Yes, SSL cert is installed - Vrushali

3 Answers

0
votes

first of all, try to find the bug comes from.
1. take backup of DB & then drop all tables.
2. re-install WordPress by remaining all files as it is.
--> if still shows the same issue then the problem comes from file structure.
&
if it works correctly then the issue comes from DB for URL mismatch.

Give your feedback about issue tracing process, so I can suggest you an accurate solution.

0
votes

If "your" SSL cert is provided by say an intermediate e.g. a CDN: Then the intermediary might be passing a "non-standard" 'HTTP_X_FORWARDED_PROTO' value e.g. uppercase "HTTPS" .

Alter your wp-config check of 'HTTP_X_FORWARDED_PROTO' to cater for these possibilities e.g.

if (stripos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false) $_SERVER['HTTPS']='on';

0
votes

similary i tried all the solutions like :

  1. clearing browser cache

  2. editting .htaccess and adding below lines

    define ('WP_SITEURL', 'https://example.com');

    define ('WP_HOME', 'https://example.com');

  3. renaming plugins

but none worked for me.

check your SSL if you are using cloudflare.

i was having problem accessing the dashboard by ftp filezilla , so i used my hosting providers cpanel.

fianlly , by putting the below code in wp-config.php worked for me.

if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') 
  $_SERVER['HTTPS']='on'; `` 

I hope it helps, thank you.