Please help. As the title says I have got to the point now of starting to tear my hair out ... something that I simply can't afford to give given that I am already folically challenged.

So my problem is this:

multisite installation on apache 2.0.63 / php 5.2.9 cpanel hosted arrangement.

site structure is

public_html
> Sites
> site1.com
> site2.com
> site3.com
> default
> all

I am working on site 1 at present trying to enable clean URLS, and have read just about every help file and discussion board I have been able to find. I think I have made a right ol' mess of things and have got to the point now after trying to sort this out all day, that I am beggign for help.

.htaccess file is installed in public_html and I was really praying that someone might be able to please take a look at the code for .htaccess and tell me what is the problem with it.

When I remane .htaccess to htaccess (or whatever) I can access my site1, however when it is present in public_html as .htaccess I get the following browser error:
______________________
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@mydomain.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
______________________

AND PLUS in cpanel error logs I get: [Mon Jun 08 20:31:37 2009] [alert] [client 59.167.208.224] /home/user/public_html/.htaccess: Invalid command 'php_value', perhaps mis-spelled or defined by a module not included in the server configuration

The htaccess code is pasted below .... I have substituted my domain with MYDOMAIN.COM to show where I had it entered .... thanks in anticipation, James

#
# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.

Order allow,deny

# Dont show directory listings for URLs which map to a directory.
Options -Indexes

# Follow symbolic links in this directory.
Options +FollowSymLinks

# Make Drupal handle any 404 errors.
ErrorDocument 404 /index.php

# Force simple error message for requests for non-existent favicon.ico.

# There is no end quote below, for compatibility with Apache 1.3.
ErrorDocument 404 "The requested file favicon.ico was not found"

# 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 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

# PHP 4, Apache 2.

# 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

# PHP 5, Apache 1 and 2.

php_value magic_quotes_gpc 0
php_value session.auto_start 0
php_value register_globals off
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} ^MYDOMAIN\.com$ [NC]
RewriteRule ^(.*)$ http://www.MYDOMAIN.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 'x' to the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

# $Id: .htaccess,v 1.90.2.3 2008/12/10 20:04:08 goba Exp $

Comments

pobster’s picture

Your problem is likely that php is not loaded as an apache module. Read the manual a little more closely...

Pobster

betterlifedirections’s picture

apache is hosted by someone else.

Are you suggesting that I asked my webhost to install php module? If I can access phpinfo, would that not indicate that php mod is already installed?

sincerely

James

betterlifedirections’s picture

I need to add that when I started this process there was not a .htaccess file installed. I created one, and pinched the code from one of the discussion boards assuming that it contained everything required for making things work.

Just a side note to put things into perspective.

:)

oh... and thanks for your quick response pobster

matkeane’s picture

Hi,

If you copy-pasted the htaccess file contents from a web page, there may be some stray characters - tabs, line feeds - in there that the server doesn't appreciate. It might be worth opening the file in an editor that can replace all the line breaks with Unix line breaks, and trying to upload the file again (in text mode). Alternatively you could try using the default htaccess file from a Drupal install (there's one in the tarball download, but many systems don't show the hidden .htaccess file) and then making your changes.

betterlifedirections’s picture

Thanks for the suggestion. I will try getting the htaccess from the tarball. Can you please suggest which changes i would need to make to get things wokring for my configuration? Also where do I need copies of the htaccess file?

James

betterlifedirections’s picture

Hmmm ... Since I turned on view hidden files I have found .htaccess files in public_html/drupal and public_html/drupal-6.10

I am thinking that perhpas one of these is the file I should be making changes to? Which one do you think? I am running multisite config.

James

josh@pixael.com’s picture

have you tried to remove php_value instructions from your htaccess?

betterlifedirections’s picture

Hi josh,

thanks for looking in on this one :)

I removed the php_value instructions and now get:

Forbidden

You don't have permission to access / on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

Any other suggestions?

marquardt’s picture

To start with, where have you installed your Drupal? From the other responses in the comments, you have something in public_html, but then you've also got something in public_html/drupal, and also in public_html/drupal-6.10. Maybe you should agree on a single installation of Drupal (and use the .htaccess that comes with the drupal version you are installing) and remove the rest to be sure what you are looking at. BTW, Drupal is now at version 6.12; do update!

Then, where is the document root that is served by the Apache server? That directory should be where (a) you install Drupal (without any subdirectories named drupal...) and (b) you should have a proper .htaccess file. I would think that in most cases, this directory is public_html on a shared host. You can install Drupal in a subdirectory of something (like in public_html/drupal-6.12), but you'll then probably have to adapt the DocumentRoot setting of the Apache server accordingly.