WordPress.org

Ready to get started?Download WordPress

Forums

How to make post previews work with different site address URL? (8 posts)

  1. winslow.strong@gmail.com
    Member
    Posted 1 year ago #

    Dear all,

    I can't preview any private posts or drafts when my site URL and WP URL are different, namely:

    WordPress Address (URL) https://secure43.hostgator.com/~wstrong
    Site Address (URL) http://biohackyourself.com

    If I also set the Site Address to https://secure43.hostgator.com/~wstrong then all previewing and login (see below) works, but my internal link structure contains that URL, which is not what I want.

    I'm on Hostgator shared hosting and using the WordPress HTTPS (SSL) package. As far as I can tell, I have to set up the two domains as such to get SSL to work with this plan. But please let me know if I need to make any other changes to use a different Site URL like this, because I haven't yet.

    As far as I can tell, everything else (Admin panel, the website) all work fine, except logging in is a bit buggy, as I get a 404 error at https://secure43.hostgator.com/~wstrong/wp-login
    but then I just proceed to https://secure43.hostgator.com/~wstrong/wp-admin without a problem.

    In this thread the problem is just that WP for some reason uses site URL in previewing rather than the WP Address. However, my problem is not merely that, as swapping the URL generated for a preview loads correctly if the URLs are the same, but not if they are different.

    Any suggestions would be greatly appreciated, as I am out of ideas.
    Thanks,
    Winslow

  2. pete_398
    Member
    Posted 1 year ago #

    Add a DNS type "CNAME" record at your registrar level, that points to your domain. Contact your registrar or Hostgator for help in setting up this record.

  3. winslow.strong@gmail.com
    Member
    Posted 1 year ago #

    Hi Pete,

    I'm pretty sure (if I understand you correctly) that I did that already. If I hadn't then my site at

    http://biohackyourself.com

    wouldn't be currently viewable, right?

    If I set the wordpress and site URLs as the same, then the problem is that all of my post links from e.g. the front page start using https://secure43.hostgator.com/~wstrong
    in the base of the URL. This is not the URL that I want my users to view nor to link to.

  4. pete_398
    Member
    Posted 1 year ago #

  5. pete_398
    Member
    Posted 1 year ago #

    I'm pretty sure (if I understand you correctly) that I did that already. If I hadn't then my site at

    http://biohackyourself.com

    wouldn't be currently viewable, right?

    In the DNS records for that domain, the "A" records points the domain to an IP address, and that is what makes your site 'viewable' to the internet. There is usually another DNS record, a CNAME record from memory, that should (possibly) be there.

    But read up on those links first, and see how you go.

  6. winslow.strong@gmail.com
    Member
    Posted 1 year ago #

    Thanks for your replies, Pete. I'm confused though why you recommend

    http://codex.wordpress.org/Changing_The_Site_URL#Changing_the_URL_directly_in_the_database

    From what they say on that page, they present 4 ways to change your Site and Home URLs "manually," the one you linked to being one of those ways. But I have access to my WP admin, so I can change those directly.

    Do you think that manually changing them in the database does something beyond changing them in WP admin would do?

    I will look into the CNAME. From what I've read it seems that setting different Site and Home URLs is not so bad if one is a subdomain, but that is not my situation, so maybe that is why I need something more complicated?

  7. pete_398
    Member
    Posted 1 year ago #

    Possibly it would be best to start a topic at WordPress HTTPS plugin topics , as it is the installation of the plugin that is causing problems , I think.

  8. winslow.strong@gmail.com
    Member
    Posted 1 year ago #

    The problem is not due entirely to HTTPS I think. I can disable it without changing my 2 URLs. This does fix the login issue, which is minor. It does not fix the preview issue.

    But they may know something about it in that forum, so I will check it out.

Topic Closed

This topic has been closed to new replies.

About this Topic