How I Fixed Drupal Clean URL’s Using GoDaddy Hosting
6,205 views -Posted in:
6,205 views
I use Wordpress for nearly all of my web sites, but I still own two Drupal sites. As I posted previously, I moved all my sites to GoDaddy within the last month, and these two sites were no exception. I started up a premium account, and had a main domain, and then in their control panel I mapped domain names to sub-folders. This is very handy for me in ftp, all of my web sites are available to me in one place, separated only by folder.
At first my Drupal sites appeared to work fine when I migrated them. However, it was only the home page. Any link you clicked on came up server error - both Drupal sites. I knew GoDaddy allowed Drupal, they have an autoinstall available for it in Metropolis. I setup a test dir and installed Drupal there using the automated tool. It had the same problem. Now I knew that it wasn’t my site, it was a GoDaddy problem. I called GoDaddy tech support and they raised an elevated ticket to the an advanced tech. I explained the problem to him, and told him I thought it had something to do with the .htaccess files or server setup. His response was that they “don’t debug code”.
I was going to respond when I figured out what the problem was. My main domain had it’s own (wordpress) .htaccess file. I thought at first that was the problem. Then I remembered, when you have a shared host with domains mapped to sub-directories it’s setup in the apache httpd.conf file I believe (hardcoded). Essentially, when a request comes in to that IP address from a domain name, the web server knows which folder to forward it too. (Without some customization) I don’t think the web server could handle that redirect, on top of an .htaccess file rewriting the URL’s to ‘clean url’s’ (permalinks).
So - long story short, IF you have an GoDaddy hosting account, and IF you have multiple domain names (and you’re planning on using clean URL’s), you can only do it from the root of your account (or main domain name) only. I did fix the problem, but ended up buying two additional basic hosting accounts ($3.99 per month) for each domain, and then both sites worked flawlessly.
If you have some other fix (or comment) related to hosting Drupal or Wordpress sites at GoDaddy - please comment now below!
























September 28th, 2007 at 7:18 am
hi jtpratt!
i faced a similar problem. But i managed to fix this by creating a new .htaccess file in the (subfolder/root) of my 2nd domain. This is the code for the modified .htaccess file
Have fun! no more dual purchases from godaddy :)
AmitG
Email: rapidsynopsis@gmail.com
Website: http://www.rapidsynopsis.com
_________________________________________________
#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
Order deny,allow
Deny from all
# Set some options.
Options -Indexes
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 4, Apache 2
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
# PHP 5, Apache 1 and 2
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
# Reduce the time dynamically generated pages are cache-able.
ExpiresByType text/html A1
# Various rewrite rules.
RewriteEngine on
# If your site can be accessed both with and without the prefix http://www.
# you can use one of the following settings to force user to use only one option:
#
# If you want the site to be accessed WITH the http://www. only, adapt and uncomment the following:
# RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
# RewriteRule .* http://www.example.com/ [L,R=301]
#
# If you want the site to be accessed only WITHOUT the http://www. , adapt and uncomment the following:
# RewriteCond %{HTTP_HOST} !^example\.com$ [NC]
# RewriteRule .* http://example.com/ [L,R=301]
# Modify the RewriteBase if you are using Drupal in a subdirectory and
# the rewrite rules are not working properly.
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 rules for static page caching provided by the Boost module
# BOOST START
AddCharset utf-8 .html
RewriteCond %{REQUEST_URI} !^/cache
RewriteCond %{REQUEST_URI} !^/user/login
RewriteCond %{REQUEST_URI} !^/admin
RewriteCond %{HTTP_COOKIE} !DRUPAL_UID
RewriteCond %{REQUEST_METHOD} ^GET$
RewriteCond %{QUERY_STRING} ^$
RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}/0/%{REQUEST_URI} -d
RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}/0/%{REQUEST_URI}/index.html -f
RewriteRule ^(.*)$ cache/%{SERVER_NAME}/0/$1/index.html [L]
RewriteCond %{REQUEST_URI} !^/cache
RewriteCond %{REQUEST_URI} !^/user/login
RewriteCond %{REQUEST_URI} !^/admin
RewriteCond %{HTTP_COOKIE} !DRUPAL_UID
RewriteCond %{REQUEST_METHOD} ^GET$
RewriteCond %{QUERY_STRING} ^$
RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}/0/%{REQUEST_URI}.html -f
RewriteRule ^(.*)$ cache/%{SERVER_NAME}/0/$1.html [L]
# BOOST END
# 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: boosted.txt,v 1.4 2006/12/05 10:39:19 arto Exp $
_________________________________________________
March 16th, 2008 at 7:37 pm
I couldn’t get the code above for .htaccess to work, but using rewritebase / seems to do the trick — except that now my images don’t show correctly.
Anyone know anything about the images bonking up now? They’re put in by FCKeditor in the /files/ directory.
March 16th, 2008 at 7:39 pm
Mind you, with just rewritebase / - trying to view the site directly from the original location: http://www.example.com/site1 will pop you back into the “main” godaddy site. but its reachable by the main URL except for images. :/
August 17th, 2008 at 2:48 pm
Ugh, I wish I had seen this tip before I uninstalled Drupal and put Wordpress on my new site.
Beside the clean url issue, I was also having real trouble setting up a drupal forum. Do you know of any good tutorial sites for drupal?
Dana Vienass last blog post..The Whole Truth About Diet Pills
August 17th, 2008 at 2:59 pm
@Dana - no I don’t, I used Drupal exclusively on all my sites for 2 years and then changed them all over to Wordpress for that very reason. Compare to Wordpress, there are only (maybe) 5-10% as much themes, plugins, and support for Drupal. I hate Drupal - I will never go back…
October 1st, 2008 at 8:14 am
@Dana - If you’re still having a lot of problems with the Drupal forums and haven’t stuck to Wordpress I’d be happy to help you.