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/htaccess/404/please help!

July 19, 2012 4:53pm

Subscribe [1]
  • #1 / Jul 19, 2012 4:53pm

    EmilyLimeRed

    44 posts

    This is really hard to explain. Here goes.

    I had an MSM setup that I needed to create a dev environment for. Called the host, we set it up so that the live and dev versions now both live in separate folders whereas before there was just the main htdocs folder that the whole site lived right inside of.

    Old version:  /htdocs/(ee site files, msm secondary site folder is in here too)
    New version (live):  /htdocs/live/(site files with msm inside)
    New version (dev):  /htdocs/dev/(site files with msm inside)

    There is an htaccess file in /htdocs/ with the “live” and “dev” folders that has this setup:

    RewriteEngine On 
    RewriteCond %{HTTP_HOST} ^(<a href="http://www.urbanedleadership.org|urbanedleadership.org">http://www.urbanedleadership.org|urbanedleadership.org</a>)$ 
    RewriteRule ^(.*)$ /live/urbaned/$1 [L]
    
    RewriteCond %{HTTP_HOST} ^(dev.urbanedleadership.org)$ 
    RewriteRule ^(.*)$ /dev/urbaned/$1 [L]
    
    RewriteCond %{HTTP_HOST} ^(<a href="http://www.worldclasseducationillinois.org|worldclasseducationillinois.org">http://www.worldclasseducationillinois.org|worldclasseducationillinois.org</a>)$ 
    RewriteRule ^(.*)$ /live/$1 [L]
    
    RewriteCond %{HTTP_HOST} ^(dev.worldclasseducationillinois.org)$ 
    RewriteRule ^(.*)$ /dev/$1 [L]

    And there are htaccess files on the top level of the main msm and secondary msm sites

    Main htaccess (this used to be different before we moved things, but the tech support guy at the hosting company changed it a bit):

    RewriteEngine Off
    Options +FollowSymlinks
    RewriteBase /
    
    <IfModule mod_rewrite.c>
        RewriteEngine On
        # --Removes index.php
        RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ /index.php/?$1 [L]
        # --If 404s, "No Input File" or every URL returns the same thing
        # --make it /index.php?/$1 above (add the question mark)
    </IfModule>

    Secondary site’s htaccess:

    RewriteEngine Off

    PROBLEM
    So now that that’s out of the way, the issue is with the secondary site (both live and dev versions). The homepage of the secondary site loads, but all the internal pages won’t load. I get a 404 on them and they show a requested url that is different from the address bar… see here: http://urbanedleadership.org/who-we-are but http://urbanedleadership.org loads fine.

    I’m hoping this is something stupid like a setting I didn’t change or something. I’ve been updating server paths everywhere I see them, but is there some setting in there that would cause this that I’m not thinking of? Could it be an htaccess thing? The hosting company is now deferring to the cms, and I’ve tried everything I could think of. I’m kind of desperate. The site is live.

    Help! Thanks!

  • #2 / Jul 20, 2012 9:30am

    Kevin Smith

    4784 posts

    Hi EmilyLimeRed,

    I’m nearly positive the problem here is that first .htaccess example you provided. It’s rewriting any request for urbanedleadership.org to urbanedleadership.org/live/urbaned/, so while the address bar reads only http://urbanedleadership.org/who-we-are the web server is actually requesting http://urbanedleadership.org/live/urbaned/who-we-are. Since that URL doesn’t actually exist, it’s returning a 404.

    Check with your host to see if they can take a second look at that .htaccess file. My guess is that the hosting company meant to tell the web server where the domain’s web root was, not rewrite the URLs.

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

ExpressionEngine News!

#eecms, #events, #releases