Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

htaccess on ExpressionEngine MSM Site

I am running two ExpressionEngine sites on two different domain names using the MSM plugin. Site one has all the system files etc and site two is in a subfolder of site one. My question is how can I get site two to not have its index.php file in the url and still work?

Currently I have this in my htaccess folder of site one and site one works great, site two doesn't:

<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]

    DirectoryIndex index.html index.php

    # Redirect non-www urls to www
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

    # If 404s, "No Input File" or every URL returns the same thing
    # make it /index.php?/$1 above (add the question mark)

like image 599
Gareth Avatar asked Nov 05 '12 07:11

Gareth


1 Answers

The same .htaccess should work for both sites. The rewriting only involves the index.php file, which is local to each site's root.

One possible issue I see from your .htaccess is that you're redirecting non-www URLs to www. Is your second domain setup to work with www? If not, this would obviously be a problem.

like image 192
Jeremy Gimbel Avatar answered Sep 28 '22 10:09

Jeremy Gimbel