Domain mapping add extra subdirectory to my mapped domain

I mapped http://www.utm.my/ideas to http://ideabank.utm.my but it goes to http://ideabank.utm.my/a/ideas

However, if I entered http://www.utm.my/ideas/ (notice the trailing slash), it works fine.

It happens to all mapped domain. Any thought?

  • Shawn

    Domain mapping actually handles the example.com => example.net/blog/ conversion - not the other way around. I know it sounds like it's all the same - apples and oranges and all that - but it's really not.

    You see, on a multisite setup the original blog mapping is only valid when an actual blog is referenced. The first child slash is what converts (in WP fashion) a URL to a blog. If that slash isn't included then the native 404 handling comes into play, parses NOT ONLY the blog name but assumes the first public ID# for published content with any terms in the URL. That means that when you pass the blog name without the slash and have content on the blog that uses the same term - it's going to dig deeper than the blog homepage. This is annoying. This is odd. But this is how WP handles it. There's at least a couple different bug reports about it, but I don't think they really ever conveyed the significance of the issue as is done in this specific thread.

    Anyway...it seems that what you *really* want is simply a redirect to address a slashless 404. The best solution is to simply do that. Of course, keep the domain mapping assigned, after all - you DO want the "ideabank" URL, but for this type of URL thing you also need to setup a redirect. htaccess is the best place for it, and that's really simple:
    RewriteRule ^ideas/?$ http://ideabank.utm.my/ [R=301,L]

  • aecnu

    Greetings Mohd Sharul Hafiz,

    Shawn's explanation is by far one of the best explanations I have ever seen on this subject.

    There's at least a couple different bug reports about it, but I don't think they really ever conveyed the significance of the issue as is done in this specific thread.

    The bug reports are relevant to this being a WordPress core problem and not conveyed near as well as you folks have here in this thread.

    Not that we have with the aid of Shawn figured out the what and the who, did Shawn's htaccess rewrite rule resolve your issue as it should have?

    Please advise.

    Cheers, Joe

  • msh

    The only reason I want to solve this problem is that users that bookmark the old url, will be automatically redirected to the new domain, and I just found this bug in the latest WP version, I think it starts with 3.3.x, since before this, this plugin redirect just like using the htacess method.

    I've done a lot of time redirecting url using htaccess, and forgot about it when it comes to this plugin.

    So for the time being, the htaccess will be the best solution for this bug.

    Thank you Shawn and Joe.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.