Support » How-To and Troubleshooting » is_user_logged_in fails if WordPress address (URL) not equal Site address (URL)

is_user_logged_in fails if WordPress address (URL) not equal Site address (URL)

Viewing 7 replies - 1 through 7 (of 7 total)
  • esmi


    Forum Moderator

    Undo all of your domain redirections and then review Giving_WordPress_Its_Own_Directory.

    Thank you for your response, however that doesn’t address the issue. I have wordpress in its own directory running fine (i.e. wordpress address and site address are the same domain).

    My problem is that the is_user_logged_in doesn’t work if the wordpress address domain and site address domain are different.

    I”m wondering if what MarkRH said

    The cookies are being set with a backtolifemeditations.com domain when logging in; however, the CD pages below are going to http://www.backtolifemeditations.com instead so the cookie does not match.


    is the same problem and if so how can make this work (i.e. adduress URL domain & site URL domain are different) so I can tell if someone is logged in and get their user info?

    Thanks for any help.

    Found the solution and it was easier than I thought. Since I have set up my hoster to point http://www.therealdomain.org to http://www.thehostingdomain.org/blogdirectory I thought that perhaps WordPress won’t realize the blog is in a directory if set the “WordPress address (URL)” to http://www.therealdomain.org also (i.e. both General Settings page WordPress address (URL) and Site address (URL) are set to http://www.therealdomain.org).

    It worked like a charm — just as if I was hosting on http://www.therealdomain.org and installed the blog in the root there. I had to go through some of the tables and fix up some URLs plugins had set as options, and a few URLs in some posts, but over all nothing much needed to be changed.

    Hi, Nanowisdoms.

    I think I have the same situation like yours. I’ve followed the way you did. It works well at the first glance (at least, the login problem is solved).

    What my question is, what is the follow-up steps after the changing the both General Settings page WordPress address (URL) and Site address (URL)? could you tell me in detailed about it?

    thank you very much!

    The only other thing I had to do was manually fix up the .htaccess file. I had set my permalinks to /%post_id%/ but after changing the site and wordpress URL, I checked the permalink page and for some reason it said it could not update the .htaccess file due to security restrictions, but it gave the lines to put there. (If I change WordPress URL back, the .htaccess is updated fine, so must be something to do with access via the therealdomain.org.) So I cut and paste them via ftp into the .htaccess file located here:

    and removed the old lines in the file. Essentially the difference was the new lines didn’t reference /blogdirectory any more. The whole blog looks and works like it’s at:

    and not at:

    So far WordPress doesn’t know otherwise. Even my robots.txt file, etc. are all in http://www.thehostingdomain.org/blogdirectory and they’re all accessed as if they are in the root of http://www.therealdomain.org/.

    The other thing I did was go through the various tables using myPhpAdmin. Back up your database first. Then I accessed each table and searched for “blogdirectory”. Where ever I found it I changed (usually):

    Most of the changes were in tables created by plugins and wp_options. For example in wp_options, I’d browse the table, click on “Search” and whre it says:
    option_value longtext utf8_general_ci LIKE %…%

    I would enter “blogdirectory” without the quotes. That would give a list back and I would edit each item manually. Cut and paste into notepad, and search for “blogdirectory”, make the change, paste back into myPhpAdmin and update.

    Also I had to update any URLs pointing to my own blog in my own posts. Those I found using:
    I made the changes manually, but used search-regex to find them.

    And then I had to fix any hard-coded menu/nagivation items I had.

    Basically look everywhere (plugin configurations, PHP code, CSS files for background image URLs, widgets, etc. etc.) for
    and change it to

    There were a few items in the options tables that just looked rathter strange and I didn’t change (can’t remember which now, but I think they are to do with recently edited stuff and gets revised on it’s own.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘is_user_logged_in fails if WordPress address (URL) not equal Site address (URL)’ is closed to new replies.