WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Sub domains problem (12 posts)

  1. scratali
    Member
    Posted 4 years ago #

    Hi
    I had a subdomain before activating multi site network in wordpress 3. Now after activating it, I can't use it as it was. How can I solve this problem? In multi site, I can't have separate sub domains created directly from cpanel?
    Thanks in advance

  2. tdjcbe
    Member
    Posted 4 years ago #

    Forgive me for no copy and paste but I;m not feeling well. Search for previous submains. It's a three line fix in htaccess as well as marking the url as being unusable in the Site -> options page/

  3. Go to Super Admin -> Options and look for the banned site names list. put the pre-exsiting subdomains in there.

  4. tdjcbe
    Member
    Posted 4 years ago #

    Do we not have to do the htacess fix then?

  5. Dunno. Figured I;d give at least that half of the answer. for some, that has fixed it.

  6. scratali
    Member
    Posted 4 years ago #

    I've done instructions in this topic:
    http://mu.wordpress.org/forums/topic/681

    i.e putting these three lines in public_html/.htaccess and public_html/wiki/.htaccess:

    RewriteCond %{HTTP_HOST} wiki.mydomain.org
    RewriteCond %{REQUEST_URI} !wiki/
    RewriteRule ^(.*)$ wiki/$1 [L]

    but nothing differently happens ans still when I go to wiki.mydomain.org, it redirects to mydomain.org. What's the problem? (i've added wiki to banned list).

  7. Do you still have the wildcard record on the server and in your DNS? :)

  8. scratali
    Member
    Posted 4 years ago #

    Yes, my problem somehow has been solved.
    I've added the wildcard record, added "wiki" to the banned list, deleted the old subdomain and created a new one, but I didn't put these lines in .htaccess:
    RewriteCond %{HTTP_HOST} wiki.mydomain.org
    RewriteCond %{REQUEST_URI} !wiki/
    RewriteRule ^(.*)$ wiki/$1 [L]

    I don't know exactly how this problem solved (or does it exist in the first place!?), maybe the support from my host have done something or maybe just deleting and recreating the subdomain was the solution.

  9. scratali
    Member
    Posted 3 years ago #

    Now I have a weird problem. My problem did fix at the first by deleting the subdomain (i.e wiki.mydomain.org) and recreating it. The problem now is it works fine for some days (say 4, 5 days) and then it'll redirects to main domain saying that this subdomain is banned from register (I added wiki to the banned site names' list). What is the problem and is that a problem with my host's settings?

    I even added these three lines in .htaccess:
    RewriteCond %{HTTP_HOST} wiki.mydomain.org
    RewriteCond %{REQUEST_URI} !wiki/
    RewriteRule ^(.*)$ wiki/$1 [L]

  10. Yeah, it's your host.

  11. scratali
    Member
    Posted 3 years ago #

    Another thing that I've discovered is that after said time (3 or 4 days), subdomain turns to a sub-directory. What could be the problem?

  12. scratali
    Member
    Posted 3 years ago #

    My problem solved permanently by simply doing this:

    Adding these three lines ABOVE the wordpress htaccess settings:
    RewriteCond %{HTTP_HOST} wiki.mydomain.com
    RewriteCond %{REQUEST_URI} !wiki/
    RewriteRule ^(.*)$ wiki/$1 [L]

    (of course below these:
    RewriteEngine On
    RewriteBase /
    )

    By saying wordpress htaccess settings, I mean:
    # BEGIN WordPress
    RewriteRule ^index\.php$ - [L]

    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]

    # END WordPress

Topic Closed

This topic has been closed to new replies.

About this Topic