Support » Networking WordPress » subdomains on Multisite: htaccess & index.php settings

  • Resolved Beeblebrox-BSD


    I’m preparing a Multisite where only sub-domains should be served by WordPress, while the domain its self should not. Specifically,

    • and should be served by contents of folder
    • * (except www) to be served by folder

    I need to write two separate rule-sets to make this happen and my problem is with the rule involving WordPress. Here’s what I have thus far:

    ## RULE-1 works
    <IfModule mod_rewrite.c>
       RewriteEngine on
       RewriteCond %{HTTP_HOST} ^(www.)?$
       RewriteRule ^(.*)$ /main/$1 [L]
    # RULE-2 begin WordPress
    <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteCond %{HTTP_HOST} ^$
        RewriteRule ^(.*)$ wordpress/$1 [L]
    # END WordPress

    With RULE-2, I’m able to get the hard-coded URL to show the main page (and without displaying the folder path). But I have problems:

    • No other path (like wp-admin) works, drops to “internal server error”
    • This being the simplified case, I need to write the RewriteCond for all subdomains, not just rs.
    • I’m concerned that Rewrite condition/rules for MultiSite are going to be a mess?
    • There’s no file as this breaks the site from working. Thus, I have not defined anywhere the necessary “require( dirname( __FILE__ ) . ‘/wordpress/wp-blog-header.php’ );” How should I do this in this instance?

    This is a fresh WordPress install, so no prior settings other than site-url set as

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello

    Did you check the Wildcard in cpanel ?

    Did you check the Wildcard in cpanel ?

    Do you mean DNS records? If there were problems with that, would not be able to resolve (which as stated it does)

    If you mean the site-url in the WordPress panel, the first step should be to get the simplified case of single sub-domain to work before the subsequnet steps of MultiSite?

    WildCard in Cpanel means to you have setup Subdomain as wildcard

    can you leave your URL here so i can check what exactly you are getting then i can help you in one short


    Solved RULE-1. This means RULE-1 no longer breaks when I enable RULE-2.

    On to issue of “* (except www) to be served by folder”

    wpemy: Unless you have a better explanation, the problem has nothing to do with a * DNS record.
    * MultiSite is not enabled yet. I posted in this sub-forum because I want this issue tracked in a single thread.
    * Records for URL are obviously working, otherwise the browser would not reach the WP front page at all. sub-folders to the URL (like have no relation to DNS (subdomain) records or http’s document_root.

    I now simplify the original question:
    WP Codex states two important steps for WP located in subfolder
    1. Modify index.php
    2. Modify .htaccess to subfolder path.

    Assuming all “*” URL’s safely get passed to the folder, how must the above 2 files be modified to get WP working properly? Single subdomain case first, and wildcard (all subdomains) case separately if possible please.


Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘subdomains on Multisite: htaccess & index.php settings’ is closed to new replies.