Hello all,
I recently installed Drupal on my domain hosted by hostmonster.com using Simple Scripts.
Everything seemed to set up perfectly, except that when I try to enable the Clean URL option in Site Configuration, I am unable to do so and the following message is displayed: "Your system configuration does not currently support this feature. The handbook page on Clean URLs has additional troubleshooting information"
I opened a ticket with customer support at hostmonster, and they told me:
Dear Customer,
All you need to do it add there code to the .htaccess file.
in the cpanel click on file manager, then browser to the public_html, then right click on .htaccess and edit.
I then read the Clean URL handbook page and searched through the Drupal Knowledgebase, and I found the sample htaccess code given here: http://drupal.org/node/121834
The knowledgebase article says that some users had gotten this code to work with hostmonster drupal sites, but it didn't work for me unfortunately. Even when I put that code into my htacesss file, I still can't get the option to enable clean url's working.
(Note: I took care to follow the instructions and to modify line 68 as specified to account for the subdirectory of my drupal install.)
Are there any hostmonster drupal users out there who have successfully enabled clean urls and can tell me how? Or any good samaritans who have a hunch as to why I'm unable to do so?
Thanks a lot,
jmn
Comments
mod_rewrite
If mod_rewrite is running on hostmonster.com then this might help:
http://httpd.apache.org/docs/mod/mod_rewrite.html.
Here's a cheat sheet for mod_rewrite:
http://www.ilovejackdaniels.com/mod_rewrite_cheat_sheet.pdf
Hi Matt, Thanks a lot for
Hi Matt,
Thanks a lot for the response. I've pondered the links you sent, but unfortunately I think that writing the htaccess file myself would be way over my head!
I can sort of get the sense of what mod_rewrite is all about by reading those files, but the language is greek to me :-)
I was hoping there was another hostmonster drupal user out there who could confirm what htaccess code worked for them and could paste it in here for me...or failing that, perhaps an educated guess as to why the sample code given in the drupal knowledgebase (link posted above) wouldn't work for me and what I could change to fix it.
Anyways, thanks again for your help. Here's hoping someone out there has managed to solve this problem before.
Justin
Got it sorted out FINALLY:)
Hi all,
After spending all day with this I FINALLY got this working!:)) I am with Hostmonster btw and have two drupal installations on my site (each in subdirectory of course). What I did after trying out several different things and reading a bazillion posts was copy the required code (which I will paste in below) into a .htaccess file and then placed a copy of it into each of my drupal installation subdirectories. You can either create a new .htaccess file on your local machine or copy the one that is already at your root on hostmonster. Please ask if you have any (BASIC) questions. I am still a newbie at ALL of this stuff since I just started w Drupal a month ago. The way I get things working (like all of you:) is by reading post after post after post:)
This Works with Hostmonster!
Thank You Talyia!
You saved me lots of time and nerves with this one!
It seems that Apache mod rewrite is enabled by default when it comes to Hostmonster and to use it you have to have proper .htaccess file.
All I did is to copy the code you provided and voila: "enable clean url" becomes an option at Drupal admin panel!!!
Also, do not forget to rename htaccess.txt to .htaccess (at least I had to do that).
It works!!!
Works with Bluehost too!
Works with Bluehost too!
Thanks a lot worked with
Thanks a lot worked with Hostmonster; I just got 5.x installed manually coz i wanted some features that weren't available in 6.x. But got stucked with the this; thanks alot again
D
Thanks
Works with drupal 6.9 on hostmonster. Very appreciated.
clean URLs not working on Hostmonster
Hi folks,
I'm setting up a Drupal 6.11 instance on Hostmonster in a subdirectory (it's in
/public_html/cms/).The code above for .htaccess doesn't work for me. I tried it with and without
RewriteBase /cmsand I tried it in/root(what Hostmonster callshome), in/public_html, and in/cms(my Drupal directory), and Drupal kept saying that my config is wrong for clean URLs.Oh, and I tried most of that with and without the Path module enabled.
Any suggestions would be marvelous.
~ curious-trick
clean urls working now on hostmonster
Clean URLs works now.
Context:
- I have not yet linked my site to a domain name, so I access it via
http://[IP address]/~[my Hostmonster name]- Path module is enabled (I don't know if this matters)
- .htaccess file is in /public_html/cms (that's my Drupal directory) and ONLY there (I tried multiple .htaccess files earlier)
- in .htaccess, I have the line
RewriteBase /~[my Hostmonster name]/cmsClean urls works with /~hostmonster_username/drupal_folder
Thanks Curious Trick,
Your trick worked for me and after reading so many pages on the web as to why it was not working and after about 10 hours of effort.
Thanks a lot !!!
.htaccess
I have same problem as above.
I am transferring site from dedicated to hostmonster.
So my temporary url is like this http://74.220.215.241/~laborfa2
my code is placed under public_html/lf/main/com folder
Actually I am new in PHP.And I dont know how to write .htaccess file.I have httpd_conf of old server.
Following is my httpd_conf.I just copied it to .htaccess but it not works.
So can you tell me how to write .htaccess for that.
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
#
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any block.
#
AllowOverride All
Alias /images /lf/main/images
Alias /css /lf/main/css
Alias /js /lf/main/js
Alias /photos /lf/var/photos
DocumentRoot /lf/main/com
ServerName http://74.220.215.241/~laborfa2
ServerAlias http://74.220.215.241/~laborfa2
RewriteEngine on
#RewriteLogLevel 2
#RewriteLog logs/rewrite.log
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME}.php -f
RewriteRule ^/(.*)(/?)$ /$1.php [L]
RewriteRule ^/([a-zA-Z]+)([a-zA-Z0-9_]{3,15})(/?)$ /profile.php?fairid=$1$2 [L]
RewriteRule ^/([a-zA-Z]+)([a-zA-Z0-9_]{3,15})/([a-z]*)(/?)$ /$3.php?fairid=$1$2 [L]
Thanks,
Sandhya
mod rewrite --.htaccess
I am transferring site from dedicated to hostmonster.
So my temporary url is like this http://74.220.215.241/~laborfa2
my code is placed under public_html/lf/main/com folder
Actually I am new in PHP.And I dont know how to write .htaccess file.I have httpd_conf of old server.
Following is my httpd_conf.I just copied it to .htaccess but it not works.
So can you tell me how to write .htaccess for that.
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
#
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any block.
#
AllowOverride All
Alias /images /lf/main/images
Alias /css /lf/main/css
Alias /js /lf/main/js
Alias /photos /lf/var/photos
DocumentRoot /lf/main/com
ServerName http://74.220.215.241/~laborfa2
ServerAlias http://74.220.215.241/~laborfa2
RewriteEngine on
#RewriteLogLevel 2
#RewriteLog logs/rewrite.log
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME}.php -f
RewriteRule ^/(.*)(/?)$ /$1.php [L]
RewriteRule ^/([a-zA-Z]+)([a-zA-Z0-9_]{3,15})(/?)$ /profile.php?fairid=$1$2 [L]
RewriteRule ^/([a-zA-Z]+)([a-zA-Z0-9_]{3,15})/([a-z]*)(/?)$ /$3.php?fairid=$1$2 [L]
Thanks,
Sandhya
Thanks!
Awesome post Talyia..thank you
thanks alot
This was really helpful, and worked straight away, thanks!
.htaccess
I am transferring site from dedicated to hostmonster.
So my temporary url is like this http://74.220.215.241/~laborfa2
my code is placed under public_html/lf/main/com folder
Actually I am new in PHP.And I dont know how to write .htaccess file.I have httpd_conf of old server.
Following is my httpd_conf.I just copied it to .htaccess but it not works.
So can you tell me how to write .htaccess for that.
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
#
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any block.
#
AllowOverride All
Alias /images /lf/main/images
Alias /css /lf/main/css
Alias /js /lf/main/js
Alias /photos /lf/var/photos
DocumentRoot /lf/main/com
ServerName http://74.220.215.241/~laborfa2
ServerAlias http://74.220.215.241/~laborfa2
RewriteEngine on
#RewriteLogLevel 2
#RewriteLog logs/rewrite.log
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME}.php -f
RewriteRule ^/(.*)(/?)$ /$1.php [L]
RewriteRule ^/([a-zA-Z]+)([a-zA-Z0-9_]{3,15})(/?)$ /profile.php?fairid=$1$2 [L]
RewriteRule ^/([a-zA-Z]+)([a-zA-Z0-9_]{3,15})/([a-z]*)(/?)$ /$3.php?fairid=$1$2 [L]
.htaccess.txt (just rename it)
What worked for me is just to rename the "htaccess.txt" that comes with the drupal installation package to ".htaccess" and that's all! :) ... I hope this could help.
What I did for hostmonster to make it work
I had a .htaccess file which only had
"# Use PHP5 Single php.ini as default
AddHandler application/x-httpd-php5s .php"
and a .htaccess.txt file with a lot more info.
I opended the .htaccess.txt file and paste the quoted info above in the .htaccess just below the line that says
"# Apache/PHP/Drupal settings:"
then i uncommented RewriteBase /
after saving I deleted the .htaccess file and renamed the .htacess.txt to .htaccess