I've asked a question over at Stackoverflow thinking that it wasn't really EE related


But now I'm not so sure that the rules I'm using to remove index.php aren't having an effect.

Any help appreciated.

  • Can you post your final answer here for people to see without having to link? – Stephen Callender Aug 15 '13 at 10:45

This is what I eventually went with;

# Rewrite for new language based urls
# This is to try and get all current pages going to /en/(old url) with a 301 redirect
RewriteCond $1 !\.(gif|jpe?g|png|ico|js)$ [NC]
RewriteCond %{REQUEST_URI} !^/(index\.php|en)(/.*)?$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /en/$1 [R=301,L]

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

I'm sure that could be refined a fair bit as there is some duplication but it works so I'm happy with it for now as it is a temporary requirement.

  • Did you ever refine this at all? – Stephen Jun 13 '14 at 15:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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