How can I achieve friendly URL ( www.xyx.com/abc )on 1and1 without destroying my website ?I tried it once and my site crashed. Lucky to have it back.

Comments

bwv’s picture

If you adjust your .htaccess file by uncommenting the rewrite base line, you should be fine:

# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
RewriteBase /abc
----------------------------------------------------------------------
http://music.bwv810.com
http://davidhertzberg.com
Feedback: http://drupal.org/node/180284

I am a writer, researcher and solo drupal freelancer.
Je peux communiquer en français.

electronicmonkey’s picture

If things go wrong, how do I recover ?

bwv’s picture

Just return the .htaccess file to its original form. But I have done this a hundred times on 1and1 and it works fine, assuming you have installed your site correctly.

You can also check your settings.php file and uncomment the base URL line, which sometimes is needed to fully remedy the problem:

 * Base URL (optional).
 *
 * If you are experiencing issues with different site domains,
 * uncomment the Base URL statement below (remove the leading hash sign)
 * and fill in the URL to your Drupal installation.
 *
 * You might also want to force users to use a given domain.
 * See the .htaccess file for more information.
 *
 * Examples:
 *   $base_url = 'http://www.example.com';
 *   $base_url = 'http://www.example.com:8888';
 *   $base_url = 'http://www.example.com/drupal';
 *   $base_url = 'https://www.example.com:8888/drupal';
 *
 * It is not allowed to have a trailing slash; Drupal will add it
 * for you.
 */
# $base_url = 'http://www.example.com';  // NO trailing slash!

----------------------------------------------------------------------
http://music.bwv810.com
http://davidhertzberg.com

I am a writer, researcher and solo drupal freelancer.
Je peux communiquer en français.

conniec’s picture

Ditto on bwv's solution. It works for me, too.

BTW, found this one out through trial and error: If you have your site on 1and1 as www.mysite.com/public_html and you have the 1and1 directory set as www.mysite.com/public_htm for your home directory, you do not change your base to www.mysite.com/public_html . Just use www.mysite.com

Connie

electronicmonkey’s picture

I get Error 500 when I click "run the clean url test" link.

conniec’s picture

My site didn't do that. But I had some problems with my first drupal installation (D4.7) because I didn't know how to set up my htaccess file when I had my drupal site in a subdirectory.
Do you have your drupal site in a subdirectory?

Also, last time I researched 1and1, they defaulted to php4.

To make them default to php5, add this to your .htaccess file, at the top:

AddType x-mapp-php5 .php

Connie

electronicmonkey’s picture

Tried that and it completely gives Error 500 whatever I try to do . I could only recover by deleting .htaccess Following is the content of my .htaccess

AddType x-mapp-php5 .php
#
# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
  Order allow,deny
</FilesMatch>

# 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.
<IfModule mod_php4.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
  # 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
</IfModule>

# Various rewrite rules.
<IfModule mod_rewrite.c>
  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 old-style URLs of the form 'node.php?id=x'.
  #RewriteCond %{REQUEST_FILENAME} !-f
  #RewriteCond %{REQUEST_FILENAME} !-d
  #RewriteCond %{QUERY_STRING} ^id=([^&]+)$
  #RewriteRule node.php index.php?q=node/view/%1 [L]

  # Rewrite old-style URLs of the form 'module.php?mod=x'.
  #RewriteCond %{REQUEST_FILENAME} !-f
  #RewriteCond %{REQUEST_FILENAME} !-d
  #RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
  #RewriteRule module.php index.php?q=%1 [L]

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

# $Id: .htaccess,v 1.81.2.4 2008/01/22 09:01:39 drumm Exp $
conniec’s picture

My .htaccess file looks exactly like yours. Hmm. Let's go a step back then. Are you using the Linux package or the Windows packages? Are you using Mysql 4 or Mysql 5? Are you using a subdirectory for your Drupal installation?

Connie

electronicmonkey’s picture

Linux
MySQL database 4.0.27
PHP 4.4.9
Drupal 5.7
Web server Apache/1.3.34 Ben-SSL/1.55
main directory

conniec’s picture

MySQL database 5.0.51a
PHP 5.2.6

Here's the only thing different between your setup and mine. I can't tell you why mine works and yours doesn't. That's beyond the scope of my trial-and-error knowledge. This is a new setup, right? Can you start over and use the 5.0 database? And add that line about php 5 into your htaccess file too.

Why are you installing Drupal 5.7? Drupal is up to 5.10 now. I've got 1and1 sites on both drupal 5.10 and 6.4 that are all working correctly.

Hang in there! I started playing with Drupal this time last year and have become a devoted fan. (Defected to Joomla for awhile. Found it much easier to set up but it wasn't flexible enough for me and I was not happy with all the paid modules that may or may not work when Drupal offers so much out of the goodness of the contributors' hearts.)

Connie

suddenfire’s picture

AddType x-mapp-php5 .php

at the top using drupal 6.15 with ubercart

you can also try adding
AddHandler x-mapp-php5 .php

here is more information:
http://drupal.org/node/322913