The MU forums have moved to WordPress.org

.HTACCESS and subdomain problems (4 posts)

  1. maxius
    Member
    Posted 16 years ago #

    Hi there, this problem is driving me INSANE and I can't find a simple answer anywhere.

    I se up MU, it works ok, EXCEPT I have a directory in the same site as MU, and it doesn't work now. HOW do I add a htaccess setting that EXCEPTS whatever MU does, so the subdirectory will work.

    ie.
    /public_html/
    - wp-inst/
    - bobblog/

    I access the bob directory by typing in bobblog.domain.com. But it doesn't work.

    Here's my htaccess file, I got this alternative one from somewhere because I am using vhosts so I didn't need all the other crap from the default WP one.

    #php_flag register_globals 0
    #php_flag display_errors 0
    RewriteEngine On
    RewriteBase /
    # Rewrite http://www.domain.com to domain.com
    RewriteCond %{HTTP_REFERER} !^http://bobblog.domain.com/ [NC]
    RewriteCond %{HTTP_HOST} ^www\.(.*)
    RewriteRule ^(.*) http://%1/$1 [R,L]
    # force a trailing slash for dirs
    RewriteRule !\..{2,4}$ - [C]
    RewriteCond %{REQUEST_URI} !^.*/$
    RewriteRule ^(.+)$ /$1/ [R=301,L]
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]*)/?files/(.*) /wp-inst/wp-content/blogs.php?file=$2 [L]
    # subdirectory passthru
    RewriteRule !^subdir - [C]
    RewriteRule ^(.*) /wp-inst/$1 [L]

  2. mzeecedric
    Member
    Posted 16 years ago #

    As far as I understand you want an additional subdomain? There were some threads about that here, but they might have been lost after the forums relaunch...

    This is how I got subdomains running. Add this to your .htaccess in documnet root:

    # wiki subdomain
    RewriteCond %{HTTP_HOST} wiki.domain.com
    RewriteCond %{REQUEST_URI} !wiki/
    RewriteRule ^(.*)$ wiki/$1 [L]

    Add this to the .htaccess in the directory you want to exclude (the subdomain dir):
    RewriteEngine Off
    <Files /wiki>
    ForceType application/x-httpd-php
    </Files>

    I found this some time ago in the forums. It works fine so far, except in the "IT-Damager" .htaccess.
    (don't ask for more details, I have no idea of mod_rewrite ) ;-)

  3. maxius
    Member
    Posted 16 years ago #

    Yay! IT WORKS! Thanks very much!
    Lets hope this post doesn't get deleted, so someone else will have some hair left...

    P.S. I actually am using IT-Damager's .htaccess.

  4. hdiaz
    Member
    Posted 15 years ago #

    Hi mzeecedric,
    Did you just add it to it, or do you erase also any thing?

About this Topic