WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Sub-domain internal server error after moving to root (9 posts)

  1. fidzi
    Member
    Posted 8 months ago #

    Hello,
    I have WP multisite configured as sub-domain (subsite.example.com). I had test enviroment in test.example.com with main site and subsite.test.example.com with sub-domain. Everything was OK.
    But, I moved WP to root, now is main page on http://www.example.com and sub-domain on subsite.example.com. But sub-domain not working and shows 500 Internal Server Error. WP admin dashboard the same. Main page is correct.

    I proceed step by step:
    http://codex.wordpress.org/Moving_WordPress#Moving_WordPress_Multisite
    and edited DB with:
    http://interconnectit.com/124/search-and-replace-for-wordpress-databases/

    htaccess:

    # BEGIN WordPress
    <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>
    
    # END WordPress

    wp-config:

    /** Sets up WordPress for multiple blogs  **/
    define('WP_ALLOW_MULTISITE', true);
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', true);
    define('DOMAIN_CURRENT_SITE', 'example.com');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    Please, help. Thanks

  2. But sub-domain not working and shows 500 Internal Server Error.

    For a test, rename .htaccess to old.htaccess

    Do you still get the error 500?

    If so, it's probably not WordPress and instead is how you created the subdomain on your server. Delete the subdomain on the SERVER and redo it. Do not delete the SITE on your network, leave that alone. Most likely, the problem is that your server isn't pointing to the right place.

  3. fidzi
    Member
    Posted 8 months ago #

    Thank for your hint.

    After rename .htaccess, sub-domain is "NOT FOUND" instead of "500 internal server error".

    But I don't understand to:

    Delete the subdomain on the SERVER and redo it.

    I don't have subdomain physically created on server, but only configured in WP sites as subdomain mode, like site1.example.com.

    My hosting allows creating physically subdomain as folder in "_sub" folder in file system. When I create empty folder in "_sub/site1", result is "403 Forbidden".

    Uf, Is something I doing incorrect?

  4. I don't have subdomain physically created on server, but only configured in WP sites as subdomain mode, like site1.example.com.

    Well ... that's a problem :D

    See, telling WP 'Use subdomains' doesn't work if you don't tell your SERVER you also want to use subdomains. Read http://codex.wordpress.org/Before_You_Create_A_Network#Domain-based

    Subdomain not found means you did not create the subdomain on your server. Without knowing your host, or what kind of panel you have, all I can do is give a generic answer: You have to create a subdomain and point it to the location where your MAIN domain is installed.

    On cPanel, that means making a subdomain and changing the location from the default /public_html/subdomain to just /public_html/

  5. fidzi
    Member
    Posted 8 months ago #

    My hosting allows creating physically subdomain as folder in "_sub" folder in file system. When I create empty folder in "_sub/site1", result is "403 Forbidden".

    Creating subdomain is automatically in my hosting...

    When I have created subdomain,folder si empty and there is 403 Forbidden.
    What can I do else?

  6. Creating subdomain is automatically in my hosting...

    How? If you don't know, then you need to ask your hosting how to do this.

    Just ask them this "How do I make a subdomain point to the main folder of my site?" (Don't say WordPress, I promise it DOES NOT matter right now)

  7. fidzi
    Member
    Posted 8 months ago #

    Yes Ipstenu, I understand :) I try create subdomain and subdomain is OK. I can test it by coping any index.html to subdomain. Without index.html has subdomain still problem - 403 Forbidden, so I think my WP (in root) doesnt recognize subdomain, or there is any other problem...

  8. You're incorrect. It's NOT WordPress.

    I can test it by coping any index.html to subdomain.

    If this means you have a special folder for the subdomain then you are not creating the subdomain correctly.

    There should be NO folder created for any subsite. When you make the subdomain on your server, you set it's 'root' directory as the same as WordPress.

    So if WP is installed in /home/user/domain.com then the SUBdomain has to also point there.

    If yours is pointing to /home/user/domain.com/subdomain then you're setting this up incorrectly.

    WP cannot, will not, and is not supposed to recognize separate subdomains. It's supposed to translate any subdomain that shares its space, though.

  9. fidzi
    Member
    Posted 7 months ago #

    Ipstenu, you are right.
    I wrote to my hosting to set my subdomain in public_html/_sub point to public_html/ where is my WP. After this subdomain is OK.

    Ipstenu, thank you for your help and patience :-)

Reply

You must log in to post.

About this Topic