The requested URL /wp-login.php was not found on this server

Scenario 1 : URL Issue

Follow the steps below.

+++

Login into cPanel > phyMyAdmin
Select the appropriate database
Select wp_option table (the table prefix wp_ might be different)
Under the option_name field verify site URL and home rows. Mostly siteurl missed the correct URL path.

+++

 

However, In case unable to access the database (phpMyAdmin) then you should follow the below steps.

Add below code into functions.php immediately after the initial <?php line. Don’t forget to replace example.com with your own URL.

+++
update_option(‘siteurl’,’http://example.com/wp’);
update_option(‘home’,’http://example.com’);
If you are using a child theme without functions.php file, then you should have to create a new one in the child theme folder. Add following code in functions.php with replacing example.com to your site URL.
<?php
update_option(‘siteurl’,’http://example.com/wp’);
update_option(‘home’,’http://example.com’);
?>

+++
Now load login or admin page 2-3 times. It will help WordPress to execute these changes with a database. Once the website will up and running, remove above code snippet from the functions.php.

Scenario 2 : Incorrect Permission

If your site shows the error message The requested URL /wp-login.php was not found on this server, then probably a fault in file permission level. The default file permission level for wp-login.php is 644. Sometimes it is changed to 640 by security plugins.

Steps to correct permission.

Download the permission script

[root@server ~]# wget https://raw.githubusercontent.com/PeachFlame/cPanel-fixperms/master/fixperms.sh

[root@server ~]# chmod +x fixperms.sh

We can run this for a specific cPanel username.

[root@server ~]# sh ./fixperms.sh -a  iserver

For running this script server-wide and attempt to fix any incorrect permissions, run the below command.

[root@server ~]# sh ./fixperms.sh -all

Scenario 3 : Htaccess issue

Another reason may be related to .htaccess file. It can deny accessing the internal WordPress environment. To solve this issue, first download an existing .htaccess file. Generally located in the root folder, the same place where wp-config.php also be there. Now, replace your current .htaccess with following code snippet

+++

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

+++