• I am on 1and1 hosting and need to run PHP5 for some plugins and would like to use the auto-upgrade. So I added the
    AddType x-mapp-php5 .php

    To the top of the .htaccess file so it looks like:

    AddType x-mapp-php5 .php

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    When I save this all the pretty permalinks break and are taken to a server 404 page (not the 404 page defined in the template). But PHP5 does run now.

    The only way to fix this is to resave my permalink settings which it looks like overwrites the .htaccessfile and so it removes the PHP5 declaration.

    So it seems like I can either have pretty permalinks OR php5 on 1and1 hosting. Any solutions?

Viewing 5 replies - 1 through 5 (of 5 total)
  • I’ve used the AddType x-mapp-php5 .php line in a pre-existing WP install (with pretty permalinks) without any problems. Are you amending the .htaccess file in a plain text editor and re-uploading the changed file via FTP in ASCII mode?

    Thread Starter dbanksdesign

    (@dbanksdesign)

    I’m editing the .htaccess file remotely through FTP. Then I save it and php5 runs (I check phpinfo) – but the permalinks break. To fix that I re-save the permalink settings and when I refresh the .htaccess file it goes back to the original version without the AddType….

    Should I download the .htaccess file, edit, then re-upload?

    Does it have to do with it’s file permissions?

    Should I download the .htaccess file, edit, then re-upload?

    I would in your shoes. Just make sure that you edit it in a plain text editor and upload it in ASCII mode. Your FTP client may be configured to applly Binary and ASCII modes automatically based on file extension – in which case, just ensure that .htaccess is listed in the Text/ASCII list.

    Does it have to do with it’s file permissions?

    You could make it writable so that WP can make any permalink changes for you. It shouldn’t touch the AddType x-mapp-php5 .php line (I tend to place that right at the top of the file and keep the WP block right at the very end).

    Hi,

    Add this wordpress code in htaccess:

    # BEGIN WordPress
    
    <IfModule mod_rewrite.c>
    ErrorDocument 404 /index.php?error=404
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    After that have a check with old and new posts.

    Thanks,

    Shane G.

    Thread Starter dbanksdesign

    (@dbanksdesign)

    esmi – you are a scholar and a gentleman. Downloading the .htaccess file, adding the AddType x-mapp-php5 .php line at the top then re-uploading (I used Cyberduck and had it set to auto/unix line endings) worked!

    I am now running PHP5 and pretty permalinks on a 1and1 server.

    Brilliant!

    Merry Christmas!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Permalinks overwritting .htaccess on 1and1 hosting’ is closed to new replies.