• Resolved onscrn

    (@onscrn)


    I have wp installed in a subdirectory of my root. It and the blog work fine there when I access the blog by main.com/blog. But I decided I’d like for the blog to have its own top level name. I got a new domain newblog.com which maps to the main.com/blog directory. I’ve done that before (without a blog) and there was no difference between accessing files by a browser whichever name they used, the one that knew it was really just a subdirectory or the one that treated it as a separate domain. This is not the case with wp, and I haven’t been able to come up with settings of the url in the options panel (blog and wp) that will achieve that result.

    I can set the blog url to newblog.com and it will work, but if I then try main.com/blog it just bounces to the home page of main.com. If I peg the blog url to main.com/blog (as it was originally) that works too, but then newblog.com doesn’t work. I think it just goes to main.com, but I’ve encountered some “no such directory messages” at some point in my attempts, and I’ve lost track.

    I’m willing to change some php code (even hardwired to my actual setup) if someone can point me to the right place.

    There should be a way, but I am stuck.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter onscrn

    (@onscrn)

    Just to reply to myself. I got things working the way I wanted by setting the blog url to newblog.com and then using .htaccess to redirect main.com/blog calls to newblog.com. For some reason this messed up images, and I ended having to put them all the way at the top main.com, but at least it works.

    On the same sort of problem, I host my site as a subdirectory of another site (over which I have no Apache2 control, so I can’t just subdomain it or something like that). Anyway, what I have now is this:

    Hosting site: https://www.foo.com/username/blog

    blog.bar.com is currently redirected to https://www.foo.com/username/blog

    All fun and good, right? Except all links in WP are of the form https://www.foo.com/username.blog. So I changed the site url in the WP settings to blog.bar.com.

    Now, whenever I go to blog.bar.com, it goes to blog.bar.com/username/blog/username/blog.

    How do I fix this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Blog url confusion when blog domain mapped to subdirectory’ is closed to new replies.