Hi, I'm stuck and hoping someone can help me out with a fix I can understand as I'm not a developer

Recently my hosts, 1and1, decided to migrate web servers and this has caused problems for me. The new server is Apache 2.2.

The main home page appears, but when you click on a link - you get a load of sedo parked adverts.

And the support team at 1&1 suggest this:
'The only problem we can see is directly related your .htaccess file within the /cms2 directory. PHP can not be modified via .htaccess as PHP is no longer allowed to run as an apache module. Such PHP changes should be done within php.ini.'

I've no idea how to fix this - can someone possibly generate the files I need? Happy to pay someone.
Everything was working lovely on Monday 18th but has gone wrong since the migration.

Thanks - help and advice welcomed.

Phil

Comments

vm’s picture

compare your current .htaccess file with a new one from a new download. This will help determine what alterations are in .htaccess that are trying to change PHP values.

Those values should be recorded and removed.

get a copy of php.ini from the host
make the PHP setting changes in php.ini (which will use different syntax than you used in .htaccess)
upload php.ini to the root of your installation.

philrochford-smith’s picture

I'll have a go, thank you.

Re new download, do you mean a new drupal installation? ( if I sound ignorant - I am, apologies for the extra hassle )

Phil

vm’s picture

from a new drupal download @ http://drupal.org/project/drupal .

download the version of drupal you are already using
extract the contents
get the .htaccess file which will be stock (have no alterations to it which will give you a baseline to compare the one you are using against.)

aotus’s picture

I had the same problem: all my 1&1 sites were broken yesterday after the server upgrades, until I edited their .htaccess files - I just uncommented (i.e. removed the leading # symbol) from line 94 or thereabouts:
# RewriteBase /
Try it!

philrochford-smith’s picture

I'm still struggling. Very much appreciate the help as you've had the same issues.

I've had a go at removing the hash-tag on this line, unfortunately its still the same issue.
Here is what it all looked like in its orginal state - any ideas on what to strip out would be great. Thanks

------------------------------------------------------------------------------------------------------------------------

#
# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.

Order allow,deny

# Don't show directory listings for URLs which map to a directory.
Options -Indexes

# Follow symbolic links in this directory.
Options +FollowSymLinks

# Customized error messages.
ErrorDocument 404 /index.php

# Set the default handler.
DirectoryIndex index.php

# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.

# PHP 4, Apache 1.

php_value magic_quotes_gpc 0
php_value register_globals AllowOverride Options
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0

# PHP 4, Apache 2.

php_value magic_quotes_gpc 0
php_value register_globals AllowOverride Options
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0

# PHP 5, Apache 1 and 2.

php_value magic_quotes_gpc 0
php_value register_globals AllowOverride Options
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0

# Requires mod_expires to be enabled.

# Enable expirations.
ExpiresActive On

# Cache all files for 2 weeks after access (A).
ExpiresDefault A1209600

# Do not cache dynamically generated pages.
ExpiresByType text/html A1

# Various rewrite rules.

RewriteEngine on

# If your site can be accessed both with and without the 'www.' prefix, you
# can use one of the following settings to redirect users to your preferred
# URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
#
# To redirect all users to access the site WITH the 'www.' prefix,
# (http://example.com/... will be redirected to http://www.example.com/...)
# adapt and uncomment the following:
# RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
# RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
#
# To redirect all users to access the site WITHOUT the 'www.' prefix,
# (http://www.example.com/... will be redirected to http://example.com/...)
# uncomment and adapt the following:
# RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
# RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /drupal
#
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
# RewriteBase /

# Rewrite URLs of the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

# $Id: .htaccess,v 1.90 2007/10/05 14:43:23 dries Exp $

AddType x-mapp-php5 .php

-------------------------------------------------------------------------------------------------------------------------

aotus’s picture

I am no expert, sorry. But try replacing
AddType x-mapp-php5 .php
with
AddHandler x-mapp-php5 .php
(In my .htaccess file, I put this near the top, not at the bottom, although maybe that makes no difference). If that does not work, try uncommenting or commenting the lines for # RewriteBase /drupal or # RewriteBase (depending on your site root)

philrochford-smith’s picture

Hi, thanks so much for finding the time to help. I'm very grateful.

It took some doing and what felt like a painful learning curve, but it worked.

Thank you all once again.

All the best
Phil