Search code examples
wordpressamazon-web-serviceshttp-status-code-404wp-admin

I cannot enter the Wordpress login page (404)


on my website www.dubaitaxation.ae i cannot access the WordPress login page which is www.dubaitaxation.ae/wp-admin or wp-login. It redirects to /wordpress/wp-admin and shows an Error 404 Not Found. Can anyone please get me out of this?

PS. I am a beginner and the website is hosted on AWS EC2


Solution

  • I just checked your page source and it shows http://ec2-13-127-23-81.ap-south-1.compute.amazonaws.com/wordpress as the ABSPATH.

    This means in your settings ( *_options table ) one or both of these is set to http://ec2-13-127-23-81.ap-south-1.compute.amazonaws.com/wordpress instead of www.dubaitaxation.ae : siteurl or home

    You can try to update this using this function if you cannot do this in the database directly.

    function updateUrl(){
    
        update_option("siteurl","www.dubaitaxation.ae");
        update_option("home","www.dubaitaxation.ae");
    
    }add_action("after_setup_theme", "updateUrl")
    

    Put this in your active theme 's functions.php file and go to the home page.

    It should reset the options and once that is done, remember to remove the function from functions.php