Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ExpressionEngine on MediaTemple - removing index.php results in "no input file specified"

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>
like image 746
Chad Crowell Avatar asked Dec 15 '22 17:12

Chad Crowell


2 Answers

Thanks to @danielcgold for the answer via twitter:

Try using this line RewriteRule ^(.*)$ /index.php?/$1 [L] and note the ? after index.php

like image 140
Chad Crowell Avatar answered Dec 28 '22 20:12

Chad Crowell


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
like image 45
Siebird Avatar answered Dec 28 '22 19:12

Siebird