hi all. ive just installed drupal and ubercart to my directory /htdocs on the server so my domain name poits to htdocs and all of the drupal files are in that . i find that unless i delete the .htaccess file the site just comes up with an error page . my clean urls do not work and i cannot find anything remotely user friendly to expllain how to modify the .htaccess file to make the site (1) work whilst having a .htaccess file and (2) rewrite my urls so that i can get the image cache working
im pulling my hair out . i can cope with building a site etc but when it comes to code like the .htaccess file and mod rewrite it is all new to me and may aswell be in a mixture of chinese and arabic although ive sat here for two days now studying it .
im hosted with streamlin.net and they tell e i can perform mod rewrites with my .htaccess file but i cannot understand why my site vanishes to an eror page as soon as i put the .htaccess file in , let alone getting it to rewrite my urls so my images display and i can enable the clean urls module
i have two commerce sites to build and have chosen drupal over oscommerce as it looks way better . can anyone help? many thanks
Comments
Comment #1
ainigma32 commentedWhat kind if error do you see? Is the error page styled/generated by Drupal or just by Apache?
And can you see some more details in Apache's error logging?
If you want to check which part of the .htaccess file is causing the problem you could try commenting everything out and then removing the comments bit by bit.
- Arie
Comment #2
petrotool commentedHi. thans for the reply,
this is the error i get from any page on the site if the .htaccess file is uploaded
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@petrotool.co.uk 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.
here is the .htaccess code
#
# 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 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 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
# 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 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]
# $Id: .htaccess,v 1.81.2.5 2008/12/10 20:12:26 drumm Exp $
the doamin name is pointed to the /htdocs by default by my eb host and i have all the drupal files in /htdocs not in a drupal folder. i got it all installed fine apart from this error. but as i have never had any experience with apache commands or code im totally lost. i dont even know how to comment or un-comment command lines in the .htaccess file or whch line to alter if i need to .
many thanks your time is very much appreciated
Comment #3
ainigma32 commentedTo comment a line just add a '#' (hash) at the beginning of the line. As you can see most of the lines are already commented out.
The parts that start with
<IfModule ... >and end with</IfModule>belong together and should be commented and uncommented as a whole.Just give it a try. If you want to be able to return to where you started you can always make a copy of the file before you change anything.
- Arie
P.S. If you want to post anything that contains
<or>you should wrap it in 'code' tags.Comment #4
coderintherye commentedJust a start, I had the same problem, and taking out the top parts:
# Follow symbolic links in this directory.
Options +FollowSymLinks
# Customized error messages.
ErrorDocument 404 /index.php
# Set the default handler.
DirectoryIndex index.php
Worked for me. The Rewrite conditions were able to stay and php directives worked like setting memory limit.
Comment #5
petrotool commentedHi
thankyou for that advice,
when you say
"and taking out the top parts:
# Follow symbolic links in this directory.
Options +FollowSymLinks
# Customized error messages.
ErrorDocument 404 /index.php
# Set the default handler.
DirectoryIndex index.php
Worked for me. "
they are already commented out just like above, or do you mean removing the comments? "#"
im still having no joy with this but i really want to get the sites working . i cant beleive this drupal looks so good and is so easy to install but this one bit of code must be putting so many people off .
im lost! ,
"update" i have trid commenting various things out and even tried commentng everything out and the site still goes to the server error page if the htaccess file is present.
now im pulling my hair out but still determined!
Comment #6
coderintherye commentedWhat you need to do is enaable the .htaccess file, then go through and delete each line one-by-one, save the file, then check and see if it works, if not keep deleting, if so, then you know that was the line. Eventually, you will find the lines that don't work for you or you will find that none of the lines work and that .htaccess simply won't work on your current hosting configuration.
Comment #7
ainigma32 commented@petrotool: Did you find out which line(s) in the .htaccess file were causing the trouble?
- Arie
Comment #8
ainigma32 commentedLooks like petrotool won't be posting any feedback so I'm setting this to fixed.
Feel free to reopen if you think that is wrong.
- Arie