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)
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With