The MU forums have moved to WordPress.org

re-write rules for directory exception (8 posts)

  1. agrothe
    Member
    Posted 17 years ago #

    I'm sure i've seen the solution to this but i'll be darned to find it again, after an hour of searching i'm going to ask... :)

    I've got wpmu installed and working peachy in my root folder home/xxx/public_html on a shared host on domain primary.com

    I have moodle installed on secondary domain secondary.com in the folder home/xxx/public_html/learn.

    I have one file located at secondary.com/files/index.php which gives me an apache 500 error.

    I'm guess i need to add a re-write rule to my wpmu to bypass these rules:

    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]

    in order for /learn/files to be accessible? man i wish i could find that post....

  2. drmiketemp
    Member
    Posted 17 years ago #

    Actually adding in a addon domain is not recommended as you're going to have issues like this. MU should be run in a seperate account.

    You can try adding in rewrite rules. We've only covered preexisting subdomains but the rules should be something simuliar:

    RewriteCond %{HTTP_HOST} subdomain.mywpmu.tld
    RewriteCond %{REQUEST_URI} !subdomain/
    RewriteRule ^(.*)$ subdomain/$1 [L]

    I don't have a free domain or setup for me to work out the exact code but it should get you started.

  3. agrothe
    Member
    Posted 17 years ago #

    thanks for the tip!

    I'm not sure what you mean by subdomain.mywpmu.tld

    Basically my wpmu is nltourist.com
    the exception needs to be learn.connectnl.ca
    so something like:

    RewriteCond %{HTTP_HOST} learn.connectnl.ca
    RewriteCond %{REQUEST_URI} !learn/
    RewriteRule ^(.*)$ learn/$1 [L]

    ?

  4. agrothe
    Member
    Posted 17 years ago #

    Just looking at the existing re-write rules:
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]

    Can I replace the .* part of ^(.*) with something more specific, like ^(.nltourist/) ?

  5. ekusteve
    Member
    Posted 17 years ago #

    I'm not sure how you would do the rewite, but I will echo the suggestion of setting up Mu and Moodle on separate accounts. Mu can be pretty resource intensive by itself, but its nothing to the processing power you will need for Moodle if you get a few courses and concurrent users. If you start getting a lot of use on your site(and with Moodle, a lot may only be 5-10 concurrent users), then it's likely your host will shut you down...been there experienced that myself on a Lunarpages shared account.

    Your best bet would be to get a second account (about $8 a month with a host like bluehost) and install Moodle there and keep Mu on its own account.

    Just something to think about.

    Steve

  6. agrothe
    Member
    Posted 17 years ago #

    I certainly appreciate the suggestions of separate accounts. This will no doubt be the end result if the moodle site gets used. However, if the government party reviewing the site decides against using it, I'll just take it down anyway and I can't see spending money on a new hosting account until the site is definitely going to be used.

    If I comment out the
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]

    rules the problem goes away, so I'd love a solution which will allow both to work. Once I get server overload I plan on upgrading to a dedicated server anyway.

  7. agrothe
    Member
    Posted 17 years ago #

    I've got the problem solved with:

    RewriteCond %{HTTP_HOST} ^nltourist.*
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{HTTP_HOST} ^nltourist.*
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]

    I also had to up my MaxRedirects as well.

  8. drmiketemp
    Member
    Posted 17 years ago #

    The code I gave was for the previous subdomain example we used previously. You may have missed the "We've only covered preexisting subdomains but the rules should be something simuliar".

    Glad you got it working though. :)

About this Topic

  • Started 17 years ago by agrothe
  • Latest reply from drmiketemp