Take the 2-minute tour ×
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It's 100% free, no registration required.

I have a site causing me no end of trouble with index.php removal. It works on one host (EngineHosting) but not on another (Liquid Web). I have other sites on the same server at Liquid Web using the same htaccess rule that work fine. By all definition, this should work. Here's the htaccess:

# EE 404 page for missing pages
ErrorDocument 404 /index.php?/site/404

# Simple 404 for missing files
<FilesMatch "(\.jpe?g|gif|png|bmp)$">
  ErrorDocument 404 "File Not Found"
</FilesMatch>

#Options +FollowSymlinks
RewriteEngine On
RewriteBase /

# remove the www
RewriteCond %{HTTP_HOST} ^www.sitenameremoved.com$ [NC]
RewriteRule ^(.*)$ http://sitenameremoved.com/$1 [R=301,L]

# Remove trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^(.+)/$
RewriteRule ^(.+)/$  /$1 [R=301,L]

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

# Remove IE image toolbar
<FilesMatch "\.(html|htm|php)$">
  Header set imagetoolbar "no"
</FilesMatch>

I have tried the RewriteRule with and without a ?, I have ensured that the other rules are working (they are), I have verified that 'Name of your site's index page' is blank, I have removed all other rules and tested, and I have used this same rule on dozens of other sites. Here, however, it does not work.

This site is EE2, non MSM.

What can I be missing?

share|improve this question

1 Answer 1

up vote 9 down vote accepted

I went through all the trouble of writing up this question after having sunk hours into this problem, when I took one last look and -finally- something I should have remembered clicked in my head.

$config['uri_protocol'] = ""

That config variable was the trick. If you're having a similar issue, try a couple of common settings for it - AUTO and PATH_INFO usually work for me.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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