ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

MSM subdomain htaccess problems

March 09, 2012 6:02am

Subscribe [1]
  • #1 / Mar 09, 2012 6:02am

    pushloop

    422 posts

    Hey guys

    I’ve run into a very annoying issu with a MSM site, which must relate to the htaccess file removing index.php from the URL.


    The setup

    domain1.com - This is the main site.
    domain1.com/domain2 - This is the new MSM site
    domain2.domain1.com - This points to domain1.com, where a htaccess file redirects to /domain2


    The problem

    domain1.com - OK
    domain1.com/index.php - OK
    domain1.com/url-title - OK
    domain1.com/index.php/url-title - OK

    domain1.com/domain2 - OK
    domain1.com/domain2/index.php - OK
    domain1.com/domain2/url-title - Domain1 404 Error
    domain1.com/domain2/index.php/url-title - OK

    domain2.domain1.com - OK
    domain2.domain1.com/index.php - Domain2 404 ERROR
    domain2.domain1.com/url-title - OK
    domain2.domain1.com/index.php/url-title - Domain2 404 ERROR

    There’s clearly a problem with the index.php-removal. Removing it does indeed work, but the reason why this is a problem, is because I’m trying to implement Biber Ltd’s Multi Language Extension, which won’t work. I believe this problem is related to the problem with index.php removal.


    The .htaccess

    In domain1.com:

    AddDefaultCharset UTF-8
    ErrorDocument 404 /index.php/home/404
    <IfModule mod_rewrite.c>
            RewriteEngine On
            
            Options +FollowSymlinks
            RewriteBase /
     
            RewriteCond %{HTTP_HOST} domain2.domain1.com
            RewriteCond %{REQUEST_URI} !domain2/
         RewriteRule ^(.*)$ domain2/$1 [L] 
    
            RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^(.*)$ /index.php?/$1 [L]
    </IfModule>

    In domain2 I have tried the same htaccess as in domain1, both with and without the http-rewrite rule as well as with and without the trailing “index.php?” questionmark - as well as other combinations, but I simply can’t get it to work!

    I’m way past going mad here… :/

     

  • #2 / Mar 10, 2012 4:32am

    pushloop

    422 posts

    I have discovered that this issue must be related to the redirection.
    When using the redirect above, index.php under domain2.domain1.com is for some odd reason being treated by EE as the first segment in the URI.

    Also, even after removing the htaccess code to remove index.php from the URL, the site continues to work without index.php.


    I have made a tech support post about this issue here: http://ellislab.com/forums/viewthread/212831/

  • #3 / Mar 11, 2012 5:38am

    pushloop

    422 posts

    Well, things seem to have been sorted out.

    The solution was to abandon ship and start from scratch with a server setup, essentially redoing the original setup where domain2.com pointed to domain1.com, which in turn used a htaccess to redirect to domain1.com/domain2.
    Instead we convinced the server host to go for the following setup, which doesn’t require the extra htaccess redirect:

    Domain1 points to:
    /home/username/public_html/ - This is where the system folder lives

    Domain2 points directly to:
    /home/username/public_html/domain2

    Domain1 uses .htaccess to remove index.php and set our 404 page, but nothing else. Domain2 has no .htaccess.
    For the Biber Ltd multi language setup, we have one language folder for each language under each site, with their own index.php and additional .htaccess to remove before mentioned index.php from URL’s.

    This seems to have solved all the issues we were experiencing, which I guess occurred due to a combination of the htaccess redirect, removing index.php from both sites, and also - as we discovered, faulty group permission settings for one of the language folders.


    - Moderator, go ahead and close this one up if you like!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases