1

Is there any chance anyone has ever come across urls in subsites in MSM sites using index.php in them

I am using a .htaccess file in each subfolder for that site which tries to get rid of the index.php so when you try to access the raw url in the site it says 404 not found error. When you type index.php before the url to the page, it loads it pretty well and works fine but from the navigation elements with structure when you click the page nav it just goes to the url without the index.php and says 404 page error.

What I would like is to have no index.php in the url and it to go to the right page instead of saying 404 page error.

Does anyone have an idea?

Cheers, Mark

4
  • Can you show us your htaccess file for the MSM sites? And you're 100% sure the files are in the webroot folder for the respective subsites? May 17, 2013 at 16:45
  • Hi Stephen can I end it in an email to you?
    – M dunbavan
    May 18, 2013 at 19:01
  • No, it would be better if you posted it here so others might be able to help answer your question. You can remove site specific data, if you need to. May 22, 2013 at 3:19
  • Hi Stephen, I managed to fix the issue using a more generic .htaccess file.
    – M dunbavan
    May 23, 2013 at 8:27

1 Answer 1

1

When adding another sub site in EE with multisite manager it is important to note that you need a .htaccess file in the root of the sub directory along with the index.php and admin.php too.

This .htaccess file needs to be super simple and use the following conditions to work:

<IfModule mod_rewrite.c>
        RewriteEngine On

        # Removes index.php from ExpressionEngine URLs
        RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

An make sure in the sub sites global preferences that you take the index.php out of the configuration for the sites index too.

And thats what worked for me :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.