ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How to remove index.php on 1and1 Servers

April 14, 2010 2:57am

Subscribe [2]
  • #1 / Apr 14, 2010 2:57am

    c@sey

    40 posts

    Spent all day on this one. This was all I needed to get 1and1 to play nice.
    Cool thing is you don’t have to use any include or exclude mode.

    AddType x-mapp-php5 .php
    AddHandler x-mapp-php5 .php
    
    #1and1 Server EE fix
    <IfModule mod_rewrite.c>
        Options +FollowSymLinks -Indexes
        Options -MultiViews
        RewriteEngine on
        RewriteBase /subdirectory/
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php/$1 [L]
        RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5})$
        RewriteRule ^index.php/(.+)$ index.php?$1 [L,QSA] 
    </IfModule>
  • #2 / Apr 19, 2010 8:03am

    FullCreamMilkMan

    67 posts

    That’s not working for me :(

    I have EE set up in a subdirectory (so I can develop behind the existing site, as it were) and wondered if I should change the RewriteBase line. No value, including the subdirectory name, makes any difference. I keep getting 400 Bad Request errors on every page but the home page…

    If you have any suggestions, I’d gratefully receive them.

  • #3 / Apr 19, 2010 9:36am

    c@sey

    40 posts

    That’s strange. Are you on 1and1 shared Linux hosting? What URL structure are you using to access the pages?

  • #4 / Apr 19, 2010 9:39am

    poeme

    1 posts

    not working for me too
    hope for new suggestions
    thanks

  • #5 / Apr 19, 2010 9:44am

    c@sey

    40 posts

    I guess 1and1 is different for everyone. They are the worst host ever I’ve ever experienced when it comes simple things like cron jobs, htaccess, and basic apache setup.
    I tried to warn my client against them but they didn’t listen. If you use EE, do yourself a favor and move hosts asap.

  • #6 / Apr 19, 2010 9:58am

    FullCreamMilkMan

    67 posts

    Yes, it’s Linux shared hosting.

    I’ve set up a subdirectory /dev/ where I’ve successfully installed EE (1.6.8). In that subdirectory I have an .htaccess file that makes sure that PHP files are handled by PHP5 (this is my first irritation with 1and1):

    AddType x-mapp-php5 .php
    AddHandler x-mapp-php5 .php

    I’m aware that this could just be the start of my problems… :(

    Adding the lines of code from mrlee above allow the home page to work, but template groups throw a 400 Bad Request error (that seems odd, no?).

    <IfModule mod_rewrite.c>
        Options +FollowSymLinks -Indexes
        Options -MultiViews
        RewriteEngine on
        RewriteBase /subdirectory/
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php/$1 [L]
        RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5})$
        RewriteRule ^index.php/(.+)$ index.php?$1 [L,QSA]
    </IfModule>

    Substituting other values in the RewriteBase line have no effect. I’ve tried adding and removing index.php as the name of the site’s index page, and I’m not sure any combination is going to work.

    I’ve already asked the client to upgrade from their existing 1and1 Home account to a Business account to get the MySQL databases, which effectively doubled their hosting costs, and I’m very reluctant to ask them to change hosting.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases