WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Subdomain redirecting to main domain (29 posts)

  1. seldarkroom
    Member
    Posted 1 year ago #

    I hope someone can help me. I've been using similar forum posts to get to this point but am stuck :)

    So I've installed WP multisite in the root folder of the main site as instructed and after lots of troubleshooting using other forum links (thanks guys), I finally got the network admin working.

    The main site works perfectly well and the admin area works well, however the first subdomain site I created, although it shows up at the subdomain address (ie kiorapsychotherapy.lifeaftertrauma.com.au) any links to pages/posts etc redirect to the main domain rather than the subdomain address. I've installed domain mapping but don't seem to be able to get it to work either at this point and I think everything is in the correct place as per instruction :/

    In the end I want the site to redirect to its actual web address (ie kiorapsychotherapy.com.au) ... currently if I go to this url I get the following: http://lifeaftertrauma.com.au/wp-signup.php?new=www.kiorapsychotherapy.com.au
    so it's finding a 'non-existant' site. I understand that if I change subdomain install to false then it goes directly to the main domain and also if I amend the wp-config file to include a NOBLOGREDIRECT then I get the same result. Should I be looking at the DNS entries? I have a wildcard DNS set up ... i also have subdomain DNS entries ... is this correct?

    I don't want to make any more updates to the theme until I have this sorted so please excuse the WIP.

    Here is my current relevant code from the wp-config

    define('WP_DEBUG', false);
    define('WP_ALLOW_MULTISITE', true);
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', true);
    define('DOMAIN_CURRENT_SITE', 'lifeaftertrauma.com.au');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    And from the htaccess

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    </IfModule>

    I'm sure someone can see quite quickly what I've done wrong ... I'm hoping :D And I hope that I explained that clearly. This is my first multisite and am rather confused :/

    Thanks so much.

  2. Which domain mapping plugin did you install?

    http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/

  3. seldarkroom
    Member
    Posted 1 year ago #

    Hi thanks for your reply.

    Yes, that's the domain mapping plugin I installed? And I can't seem to get it to work and I've been following the tutorial but my admin area does look very different to the tutorial admin).

  4. my admin area does look very different to the tutorial admin).

    It shouldn't. That admin area hasn't changed.

    Go to /wp-admin/network/settings.php?page=dm_admin_page

    Do you have the IP of your main domain in there, and what domain options did you check?

  5. seldarkroom
    Member
    Posted 1 year ago #

    Hi Mika,
    I have the main domain IP in there and the options I've checked are these two:
    Permanent redirect (better for your blogger's pagerank)
    User domain mapping page

  6. however the first subdomain site I created, although it shows up at the subdomain address (ie kiorapsychotherapy.lifeaftertrauma.com.au) any links to pages/posts etc redirect to the main domain rather than the subdomain address. I've installed domain mapping but don't seem to be able to get it to work either at this point and I think everything is in the correct place as per instruction :/

    Okay, so you understand, permanent redirect means that mappeddomain.com will be used :)

    On /wp-admin/network/settings.php?page=dm_domains_admin if you have primary set for the domain, it'll override your main page and the subdomain won't show *except in old links.

  7. seldarkroom
    Member
    Posted 1 year ago #

    Hi Mika,
    Thanks for the response.

    Okay, so you understand, permanent redirect means that mappeddomain.com will be used :)

    (putting on dunce cap) so that's incorrect?? :/

    On /wp-admin/network/settings.php?page=dm_domains_admin if you have primary set for the domain, it'll override your main page and the subdomain won't show *except in old links.

    Ok so I know what you mean NOW, but prior to understanding what you meant I went and messed things up. I'm not sure what I was thinking at the time but when I couldn't add a site ID for 1 (as it already existed but wasn't visible in the domain mapping area) so I added that domain as 3 and made it the primary domain which created up some sort of loop as what was already 1 was now also 3 … so I created a duplicate without realising it and ended up with this error message:

    The domain mapping plugin only works if the site is installed in /. This is a limitation of how virtual servers work and is very difficult to work around.

    So after a slow process and a few new error messages and multiple blog readings looking for solutions I removed the plugin altogether and updated the wp-config.php file to remove the sunrise line and got back to the working multisite.

    Then, I tried to reinstall the domain mapping plugin with a freshly downloaded version but am getting the same error as above :(

    I at least now understand what I should be doing with domain mapping but now have this new issue before I can get back there. Any ideas on how I can fix this? Or will I need to start all over again with a completely new WP install?

    Sorry for such a mess and I hope it makes some kind of sense.

  8. Then, I tried to reinstall the domain mapping plugin with a freshly downloaded version but am getting the same error as above :(

    Which is the 'error'? (It is kinda a mess and I want to make sure what YOU think is an error is what I do too ;) )

    If it helps, you can spell it out like this:

    I want to see: http://mapped.com with internal links to http://mapped.com

    I actually see: http://subdomain.mapped.com with internal links to http://mapped.com

  9. seldarkroom
    Member
    Posted 1 year ago #

    Hey Mika,

    Hee yes it is a mess! sorry about that but I don't want to give up as I want to learn the correct way to make this happen.

    This is the error I get when I reinstall the plugin - I've uninstalled it at the moment so there is no mapping in place :(

    The domain mapping plugin only works if the site is installed in /. This is a limitation of how virtual servers work and is very difficult to work around.

    And ... I was thinking about it and realised that there could be another obvious error in that I didn't delete the preexisting subdomain setup. Should there only be a wildcard subdomain set up with no others?

    But back to your actual question and putting it the way you have (which is very clear :) ) what I ultimately want is to see http://mapped.com with internal links to http://mapped.com and what I was getting at first was http://subdomain.mapped.com with internal links to http://mapped.com but then was getting internal links to http://subdomain.mapped.com ... is that a bit clearer?

    Unfortunately due to my looping incident I now only get the error message (block quoted above) when I install the domain mapping plugin ... I was wondering if there is any code that would be hidden elsewhere that I should remove other than in the wp-config.php file before I reinstall clean?

    Thanks.

  10. Just to clarify something, you're not mapping mapped.com to subdomain.mapped.com -- That was my bad! It's mapped.com to subdomain.unmapped.com :D

    I was wondering if there is any code that would be hidden elsewhere that I should remove other than in the wp-config.php file before I reinstall clean?

    The database: http://wpmututorials.com/how-to/how-to-disable-multisite/

    The domain mapping plugin only works if the site is installed in /. This is a limitation of how virtual servers work and is very difficult to work around.

    That just means that unmapped.com has to be unmapped.com, and not unmapped.com/folder/

  11. seldarkroom
    Member
    Posted 1 year ago #

    Thanks Mika,

    So I've completed disabled multisite (thanks for the link). And before I try again to get the multisite installed from scratch can I just clarify that I should only have a wildcard subdomain set up - and no others (ie there should only be *.mydomain.com.au ... and not subdomain.mydomain.com.au as well).

    I fear as there was a subdomain.mydomain.com.au previously set up that this was creating the weird loop issue previously but I could be wrong.

    thanks

  12. And before I try again to get the multisite installed from scratch can I just clarify that I should only have a wildcard subdomain set up - and no others (ie there should only be *.mydomain.com.au ... and not subdomain.mydomain.com.au as well).

    Correct.

  13. seldarkroom
    Member
    Posted 1 year ago #

    Hi Mika,

    Finally, I'm back again and started from scratch today - methodically and slowly - and everything was going well until I Network Activated the MU Domain Mapping plugin, moved the sunrise.php file to the correct folder (ie the wp-content folder), and then added the correct "define sunrise on" definition in the wp-config.php file and then couldn't go any further as I no longer had permission to access my network admin and get the following message: 'You do not have sufficient permissions to access this page.' And the sites are no longer accessible. As soon as I remove the line everything is back and functioning.

    So I can't even get in to where I previously had issues? How odd. Any ideas on this one?

    Thanks

  14. Moved the file or copied the sunrise file?

  15. seldarkroom
    Member
    Posted 1 year ago #

    Moved the file.

    Should it be copied?

  16. Generally yes :) An upgrade would just restore it anyway.

    What are your server specs? PHP etc?

  17. seldarkroom
    Member
    Posted 1 year ago #

    Apache version 2.2.23
    PHP version 5.3.19
    MySQL version 5.1.66-cll
    Architecture x86_64
    Operating system linux

    And it's a Shared IP

  18. All of that is good. *ponder* Well the best I can think of is that your server's not supporting whatever it is that makes this work. You were using subdomains and they worked just fine before mapping, right?

  19. seldarkroom
    Member
    Posted 1 year ago #

    Hey Mika, yep the subdomain site is working but as soon as I 'turn' sunrise.php 'on' I get the 'You do not have sufficient permissions to access this page.' message :(

    Here's how it all works in full which may help - I can access the subdomain wp-admin area but if I try to access the network admin area I get the above message.

    If I try to access the main domain admin area I get this message:

    "You attempted to access the "Main domain" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "Main domain" dashboard, please contact your network administrator.

    If you reached this screen by accident and meant to visit one of your own sites, here are some shortcuts to help you find your way.

    Your Sites
    Main site Visit Dashboard | View Site
    (if I click on these the first takes me straight back to this message, and the second takes me to the site url but with a 'this is somewhat embarrassing, isn't it? message)
    Subdomain site Visit Dashboard | View Site
    (if I click on these they both take me to the correct places

  20. Are all those errors -without- mapping active?

  21. seldarkroom
    Member
    Posted 1 year ago #

    Hey Mika, These errors occur during the installation of the Multisite Domain Mapping plugin. This happens when I add the following line to wp-config.php to activate sunrise.

    define( 'SUNRISE', 'on' );

    So mapping is not yet active ... I'm not even getting that far.

  22. What are the permissions on the sunrise.php file in wp-content?

  23. seldarkroom
    Member
    Posted 1 year ago #

    Ahhh good point ... currently 644. What should they be?

  24. When you say you scrapped everuthing and started over... how scrap do you mean? Did you delete everything, the files and the DB and all?

  25. seldarkroom
    Member
    Posted 1 year ago #

    Hi, yes I deleted everything - the plug in files, and went and deleted the DB files as instructed.

    Although I just noticed that I didn't delete and reinstall the blog.dir file - only just realised the date is old? will that make a difference?

  26. No... it shouldn't. This is just weird. I can't reproduce that at all :(

  27. seldarkroom
    Member
    Posted 1 year ago #

    I'm finding the thing that's the weirdest is that the subdomain admin remains when I activate sunrise and that it's the admin for the main domain that I can't access.

    So, it makes me wonder if somehow when I did the first install and gave the subdomain a 1 allocation that that is being stored somewhere so it's getting priority. Although I would've thought that if I completely deleted the plugin and all the associated files that that wouldn't have retained that information anywhere :(

    So confused I'm thinking I may need to do individual installs for each site which would be really dull and rather annoying for my client.

    However, I may try and do an install on my own wp site and see if it works there or if I get the same error. That way we can see if it's just ME.

  28. seldarkroom
    Member
    Posted 1 year ago #

    Ok ... so after my post above I decide to give it a last shot and activated sunrise again to see if I could access any domain mapping in the subdomain admin area ... and after changing my ftp upload settings to an unsecure ftp (no idea if that made a difference) and uploading the wp-config file it enabled it (only for the subdomain still). AND ... yes I had access to mapping and changed my initial error (which I don't know how it was still there but it was) ... and deleted it. And boom! plug in is now working ... so no wonder you couldn't reproduce it cause it was ME after all ... but at least my typing out loud made me think it through a bit more.

    Now to the actual mapping and see if I can get it right this time! Stay tuned so we can close this and I can stop confusing you and frustrating myself :P

  29. seldarkroom
    Member
    Posted 1 year ago #

    Mika!!! It's done and working and I just want to thank you for your time, patience and support!!
    Thank you sooo much :D

Topic Closed

This topic has been closed to new replies.

About this Topic