I have an MT site with the standard ExpressionEngine htaccess code to remove index.php and the home page works, and all other pages work if I put index.php in the URL. Without it, I get "no output file specified". It works on my local and non-MT server, so I know its an environment thing. What in the htaccess needs to be changed to make it work on MT?
<IfModule mod_rewrite.c>
# Enable Rewrite Engine
# ------------------------------
RewriteEngine On
RewriteBase /
# Use Dynamic robots.txt file
# ------------------------------
RewriteRule robots\.txt /robots.php [L]
# Redirect index.php Requests
# ------------------------------
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{THE_REQUEST} !/admin/.*
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,L]
# Standard ExpressionEngine Rewrite
# ------------------------------
RewriteCond $1 !\.(css|js|gif|jpe?g|png) [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
</IfModule>
Thanks to @danielcgold for the answer via twitter:
Try using this line RewriteRule ^(.*)$ /index.php?/$1 [L]
and note the ? after index.php
I posted a Gist last night with my standard rewrite rules for all my ExpressionEngine sites on (mt).
## BEGIN Expression Engine Rewrite
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteRule ^(.*)$ /index.php?/$1 [L]
## END Expression Engine Rewrite
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