• Resolved Strahinja Krstic

    (@strahinjakrsticket)


    So, if I got your attention, let me be more specific.

    This is the look of my website after the homepage is refreshed. All the files I need for my website working properly are 404 and it looks like CSS is lost (also JS). And that’s the one side of the problem.

    The other side is that I can’t access my Dashboard (http://mysite.com/wp-admin) because Firefox is telling me that The page isn’t redirecting properly.

    And you know what’s crazy? Sometimes works normally, sometimes doesn’t. But there is something I know for sure: If I clean cookies, everything goes normal, but only for a couple of minutes.
    I tried a bunch of solutions from the ww.wp.xz.cn, and also from the other WP-related websites and none of them solved the problem completely (ex. deactivating plugins/theme, change home and site url in wp-config.php, reuploading wp-admin & wp-includes folder, changing folder permissions, changing permalinks etc.).

    I haven’t worked on this website for a while, and I don’t know when the problem occured. But I noticed it after pasting Google Tag Manager code in my header.php. Maybe that’s something?

    I’m sorry because of a longer post and I hope you understand my problem. Thanks in advance.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator James Huff

    (@macmanx)

    Access your database and make sure that the siteurl and home values are correct following this guide: https://codex.ww.wp.xz.cn/Changing_The_Site_URL#Changing_the_URL_directly_in_the_database

    You’ll find phpMyAdmin in your hosting account’s control panel.

    Thread Starter Strahinja Krstic

    (@strahinjakrsticket)

    Hey James,

    Thanks for reply! Changing te URL directly in the database was one of the solutions I tried. siteurl and home are set up correctly in my database. While typing this my website is working properly, but I don’t know what was the cause of the problem and if it will be back.
    I hope that we will come to the solution so we can learn something from it 🙂

    Moderator James Huff

    (@macmanx)

    Try downloading WordPress again, access your server via SFTP or FTP, or a file manager in your hosting account’s control panel, and delete then replace your copies of everything on the server except the wp-config.php file and the /wp-content/ directory with fresh copies from the download. This will effectively replace all of your core files without damaging your content and settings.

    Some uploaders tend to be unreliable when overwriting files, so don’t forget to delete the original files before replacing them.

    Thread Starter Strahinja Krstic

    (@strahinjakrsticket)

    I did what you said and it works like a dream (for now).
    One more thing I did: I deleted Google Tag Manager code from header.php and used pure Google Analytics tracking code and pasted it into the child theme’s functions.php.

    <?php
    add_action('wp_head', 'wpse_43672_wp_head');
    function wpse_43672_wp_head(){
    
    /*Here goes Google Analytics code.
    It goes to your <head> of header.php */
    
        ?>
    <?php //Open PHP tags
    }

    Thanks for your support, James. I appreciate it!

    Moderator James Huff

    (@macmanx)

    You’re welcome!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Everything is 404 error & Can't access wp-admin’ is closed to new replies.