I am working on a site that is on a subdomain with a structure that looks like this:


I would also like to remove the index.php. I looked at THIS THREAD to see if it would apply but the client has the additional /sites/project in the URL. Does anyone know how I would set up the htaccess to remove the index.php within this environment? I can't get my navigation to resolve correctly and the CSS doesn't show. Thanks in advance.

1 Answer 1


In that case you just need to change the last line of the standard .htaccess rules. (That link is worth reading in its entirety.)

<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /

        # Removes index.php from ExpressionEngine URLs
        RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
        RewriteCond %{REQUEST_URI} !/system/.* [NC]
        RewriteRule (.*?)index\.php/*(.*) sites/project/$1$2 [R=301,NE,L]

        # Directs all EE web requests through the site index file
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ sites/project/index.php/$1 [L]

Re: links and CSS, that would all depend on how you're creating your navigation links, and how you're linking to your CSS. Hard to know what's up without seeing the relevant parts of your templates.

Your Answer

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

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