• Resolved mark2

    (@mark2)


    I recently changed the home & site URL of my site… had some issues with that, but I finally got everything working (my files were in a different directory than the site URL) & the site is functioning fine (http://contractsupply.ca)

    My problem is now I can no longer log into the site admin.

    When I go to the login page (http://contractsupply.ca/newsite/wp-admin) I receive a bunch of Warning: include/failed to open stream/Cannot modify header information errors/headers already sent by, followed by the standard login screen. I can still enter my login info, but when I do, I’m directed to a page displaying the same errors.

    The errors reference the functions.php file of my theme and points to the lines containing : include(get_absolute_url(get_bloginfo('template_directory').'/config_files/content/sidebars.php'));

    I’m pretty sure this is where the problem is stemming from… I’ve gone through every support document imaginable and can’t seem to find a fix… any help/suggestions would be much appreciated!

    Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Did you follow the instructions here when moving WordPress? If not, there’s a section on there on how to make the necessary changes if you can’t access the admin, in the section titled “If you forget to change the locations”.

    Thread Starter mark2

    (@mark2)

    Hi dkotter,

    Yes, I did follow the instructions referenced in that article, as well as the Changing_The_Site_URL article.

    My siteurl value in the database is: http://www.contractsupply.ca/newsite (this is the directory that the wordpress files are located on my server)
    and my home value is http://www.contractsupply.ca (the website URL)

    I’ve copied the index.php & htcaccess file into the root directory & changed the line to :

    require(‘./newsite/wp-blog-header.php’);

    and htcaccess in the root directory to:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    The site works fine… the only issue is being able to access the admin…

    Okay looking at the error messages that show up on the login page, it looks like you have an issue in your theme. The error message references your sites functions.php file, so I’d check that out and see what the issues are there. It says around 4184, so I’d start looking around there and see what it’s trying to do at that point.

    Thread Starter mark2

    (@mark2)

    Yes, I think it’s something to do with my theme as well (it’s the Kustom theme)

    Line 4183 has this:

    include(get_absolute_url(get_bloginfo('template_directory').'/config_files/content/sidebars.php'));

    And line 4184-4186 has this:

    foreach($sidebars_names as $sidebarname) {
       register_sidebar(Array("name" => $sidebarname));
       }

    I’m stuck at what I could change in this to fix the problem…

    Yeah I think there’s an issue there with the include. I think it’s probably using the wrong URL. So you could either delete those lines, but then lose that functionality (whatever it is) or replace

    get_absolute_url(get_bloginfo('template_directory').'/config_files/content/sidebars.php')

    with the full URL, which I think would be something like http://www.contractsupply.ca/newsite/config_files/content/sidebars.php

    You’d have to make sure that URL is correct though.

    Thread Starter mark2

    (@mark2)

    I tried swapping with the full URL (http://www.contractsupply.ca/newsite/wp-content/themes/kustom/config_files/content/sidebars.php), but still showing the same errors….

    I know it’s probably a small error that’s causing this, just a question of pinpointing it..

    Thread Starter mark2

    (@mark2)

    Just noticed something in the first error that appears when trying to log into the wp-admin page….

    Warning: include(/usr/home/contract/public_html/newsite/newsite/wp-content/themes/kustom/config_files/content/sidebars.php)

    The /newsite/ directory is in there twice… I’m thinking this could be the source of the problem. From what I’ve seen, I haven’t seen any duplicates of the “newsite/newsite/” in any of my files… What do you think could be triggering this?

    Yeah that would mess it up, having the name there twice. Not sure exactly what’s going on without looking over things myself, but try using only this instead of the full URL:

    newsite/wp-content/themes/kustom/config_files/content/sidebars.php

    Basically just getting rid of the main domain name in the include.

    And if all else fails, you might need to contact your theme developer and see if they have a fix for the issue.

    Thread Starter mark2

    (@mark2)

    I (finally) solved the problem!

    Yes – it did have to do with the functions.php & the include…

    I found this article which address the problem I was having with the Warning: include() problem.

    I tried using include $_SERVER[‘DOCUMENT_ROOT’] solution instead of include() and that solved the problem. I can know access the admin panel & the site is functioning fine.

    Thanks for your help with the issue dkotter, I appreciate it!

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

The topic ‘Changed WordPress URL, Can't Login’ is closed to new replies.