I know this issue has been hashed and rehashed in the docs and on the forums, but after reading all that I can't seem to get it. I've got to be doing something wrong. I have a dedicated server on HostGator, who I have never used before now. The apache setup is a little different than what I'm used to, but all the pieces seem to be there. Still, I can't get clean urls to work.
Does anyone have any specific experience with drupal on hostgator servers? Everything is working fine with the install. Well, everything except clean urls. I'm running Drupal 5.5. On my server, I've got a lot of httpd files like:
httpd.conf
httpd.conf.default
httpd.conf.ea-orig
... and a bunch more.
Some of these look like they are auto-generated by WHM, while others look pretty standard. In the past, I have only dealt with one file on the web server, httpd.conf. So maybe the files I've looked in aren't the right ones. No matter what changes I made to something like AllowOverride All (and then restarted apache), I still couldn't get it to work.
Anyone get clean urls to work on a hostgator server?
Comments
I've not installed Drupal on
I've not installed Drupal on Hostgator before, but I would double check that you've uploaded the .htaccess file that came along with your Drupal install. These files are frequently hidden on most PCs or Macs because of the '.' name. Also make sure that its writable by the server.
Also, it would be helpful if you go into Admin -> Settings -> Clean URLs and tell us what you got from the Clean URL test. Good luck!
I would definitely look for
I would definitely look for the .htaccess file before doing anything more. That is the file that most of the documentation refers to. Do that and report back. There are details on the docs referring to exactly what needs to be done to them.
.htaccess doesn't seem to help...
Since I have root access to my server, I would prefer to do the rewrite rules directly to the conf files, but it's not the biggest deal. As far as the .htaccess file is concerned, it doesn't seem to help. I can't enable clean urls, and when I run the test, I get a page not found error. Mod Rewrite is loaded in apache, so I'm not really sure what's going on.
For the .htaccess file specifically, I have the code from this page: http://cvs.drupal.org/viewvc.py/drupal/drupal/.htaccess?view=markup . I've tried it with with RewriteBase / commented out and not commented out, both with the same results. With all that's going on, I am led to think that there's something up with my server's config. Since there are so many files, maybe I just haven't found and edited the right one yet. But, that's just the theory I'm going on right now. I'm always open to other options.
Thanks,
Caleb
http://www.education-finder.net
Keep us posted
Wish I could be of more help. Unfortunately I don't have much experience when it comes to servers. I would imagine that there might be some settings somewhere that might be overwriting your conf files. Let us know what you do to fix it for future reference. :)
this might help
I had the same problem when I first installed drupal, here is my quick hack.
Go to .htaccess Within
# Put where mount your drupal
# For instance, if your drupal is at http://yoursite/drupal
# then
# RewriteBase /drupal
RewriteBase / # <-- add this line
RewriteCond %{REQUEST_FILENAME} !-f
....
Hope this helps
Got it working now...
I actually didn't have to change anything to get it to work. Well, that's not entirely accurate. Here's the whole story.
I contact my host's support department so they can double-check my server to see if mod rewrite was on and functioning properly. It was. In the mean time, I started looking to the .htaccess file. Upon opening up the copy on the server, I saw that it was blank. I don't think a blank .htaccess file will help out much. So, I went to the drupal docs and did a fancy copy and paste from the drupal 6 .htaccess (even though I was running version 5.5 at the time, I only saw the current v6 file in the drupal docs (I don't have the url in front of me and I don't feel like searching for it right now). So, what I did was open up my Mac terminal, navigated to my drupal install folder, renamed .htaccess to htaccess.txt and then uploaded that file to my server. Once it was up there, renamed it and clean urls worked.
It was like magic. So, the moral of the story is that you should rename your .htaccess file (hidden by default in Mac OS), then upload it and rename it and everything *may* be fine for you. It was for me.
The End.
Thanks,
Caleb
http://www.education-finder.net
HostGator Clean URLs
I am having the same issue with the Clean URLs on hostgator. I tried pasting in the .htaccess file from a Drupal site I have running on GoDaddy, but that did not work.
1. Can you link me to the .htaccess file you found that did work? (I was not able to pull it up by searching)
2. Please confirm the location of the .htaccess file. When you login via FTP your Drupal install is inside of the directory public_html. This is where I have been putting the .htaccess file. Are you putting it somewhere else?
Drupal Indianapolis Web Design
Your solution worked for me!
chaoscube,
Thanks so much!!!!
Thank you your solution worked for me too
@chaoscube Thanks!
List of Blank htaccess files
Hi guys,
Thanks for the head start, following this thread I got my clean URL's working on my temp URL at Hostgator. A list of the htaccess files for each drupal version can be found here:
http://cvs.drupal.org/viewvc.py/drupal/drupal/.htaccess?view=log
The link to the one posted by chaoscube was for 7.x When I navigated from there to the one for my version (6.6), I created a new file (htaccess-hostgator.txt), pasted, changed the rewritebase (/~accountusername no trailing slash appears to work) and uploaded to web root (public_html). Then you can change the filename on the server. I did not have luck just pasting the content into the already existing htaccess file.
Do it this way and it should come right up for you. Thanks to those who started me in the right direction!
Clean URLs working on Host Gator
I am using Host Gator and love their product and service / support. The above suggestion fixed clean urls on my setup.
I have had this issue before - it's only when I am setting up under the test path for the site - until the DNS nameservers update and switch over. When developing a site - that is usually how I do it - develop under the temp path and when the client says go live then I update the nameservers to make the site go live.
Anyhow - in the .htaccess file around line number 105 you will see something like this:
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
# RewriteBase /
Just change that by un-commenting the line:
# RewriteBase /
Change it to:
RewriteBase /~your-host-gator-account-username
Just replace your-host-gator-account-username with the account username that you were given for your hosting account.
Just put it back to the way it was when the DNS updates and the site goes live on the real domain name.
Host Gator isn't the issue - it's just the info that is in .htaccess file - update that and you will be good to go.
Hope this helps someone!
Thanks!
Thanks! This worked for me.. I completely overlooked adding the ~account..
YAY....Working Now
I had the same issue on a new Drupal 7 install on a dedicated server at inmotionhosting.com. I followed your instructions and it solved the problem. Thanks So Much for posting!
I was going crazy
I was going crazy trying to figure it out what I had wrong. I couldn't get the clean urls to work, I did put the directory on the RewriteBase with the tilde and finally get them work.
Strange thing, is that I have two virtual hosts on the same VPS, in one I have Drupal 7 installed and in the other Drupal 6. I could make the clean urls work on the Drupal 6 installation but on the Drupal 7.
Any ideas what it might be?
Thanks in advance.
.htaccess
Here's what I figured out: For some reason the 6.0 .htaccess file wasn't working. I double-checked with hostgator support and they confirmed that the server was configured properly for mod rewrites.
My initial Drupal 5.5 and 5.6 .htaccess files were blank on the server. It was quite weird. I uploaded everything, opened the file in Dreamweaver, and it was blank. Then I sshed into the server, located the file in question, and opened it from the command line. It was blank. My local system is a Mac running os 10.4. By default, hidden files stay hidden, and you have to do some hoop jumping to unhide them. Well, somewhere along the way, duing the uploading, the file went blank. This only happens when uploading the file from a mac.
To get around this issue, I just located the hidden .htaccess file on my machine and renamed it htaccess.txt. Then I uploaded it, renamed it, and everything worked just fine. Here is the full text of the .htaccess file:
I hope this information helps. I was getting pretty frustrated.
Thanks,
Caleb
http://www.education-finder.net
Caleb, Thanks for your help!
Caleb,
Thanks for your help! (Mac user here too btw) I tried replacing the .htaccess file with the code you supplied, but it did not work. I have decided to cancel my HostGator account after receiving the following helpful email from the HostGator Technical support team:
As a Mac user, I have come to expect better support from vendors. Here is a helpful link for anyone who may come to the same conclusion. HostGator Cancel form
Drupal Indianapolis Web Design
.htaccess did it for me
( /public_html/.htaccess contents)
----- Begin file contents ----------
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]
------- End file contents ------------
-Douglas
I also have Host Gator and
I also have Host Gator and this solution work for me. Drupal 6.8.
Not working for me, please help!!!!
Domain has changed and is now pointing to hostgator and everything is working just fine, i really dont know how the no-domain was affecting, but is working right now. Ignore my comments under these please.
I have this code at the end of my .htaccess on hostgators installation
I'm running drupal on a subdirectory called site (/public_html/site/.htaccess)
i realy dont know whats wrong, maybe i am not seeing the obvious, could some body help me please? i have spent 2 days trying to make clean_urls work, i have talked 3 times on livechat and they told me that module rewrite is enabled and working, that "AllowOverride" is set to "All" on the httpd.conf, Im using Drupal 6.13. btw.
The domain isn't pointing to the hosting on hostgator yet, could that be the reason why this isn't working? I don't thinks so because i have the exact site running on localhost without any domain with working clean_urls. I also have 2 drupal sites on godaddy and 1 on verio with clean_urls too.
I really appreciate if somebody could tell me what am i doing wrong.
Domain pointing issue
Hi, ttnk.
I'm having the same issue where I'm unable to point the client's domain to the server/host until the production site is completed (this must be a common thing, surely?). The host support staff say this is the reason why Clean URLs aren't working (although they're unable to tell me what needs to be done). Interesting that you have other sites without domains that work ok...
I've modified settings.php and .htaccess without luck.
My other question (as it may be yours as well) is what will happen to the database if we get Clean URLs working on the yet-to-be-delegated server/host URL, ie. once the domain is pointed to the DNS, will we need to then modify URLs within the database and modified settings.php & .htaccess files?
- Tim
No changes needed
Dont worry about that because at the time you get the clean_urls working the internal paths change automatically. At least that happened with my site.
From what i have read about, it uses both paths, the clean and unclean ones, both work when you activate clean_urls.
My suggestion is that you keep on looking for this particular issue because im not very experimented in drupal yet, i have been using it for about 1 month and a half.
Good luck.
I hope you're right about the DNS
I've been working on this for 2 days, have been on live chat twice and still no dice. Yesterday I had the DNS servers pointed to hostgator, hopefully that will solve the problem, though it seems so weird since I had clean URL's working on my local machine just fine.
This is my first drupal project, and this is by far and away the most frustrating part of it.
Yep, the DNS just came through and it works!
Just wanted to let everyone know that my experience with hostgator was the same. Couldn't get clean URL's to work, but as soon as the DNS came through, it's up and running like a champ!
And I fell for this again!
I've had this issue before, and I've just realized what it is again!
I'm doing the same as a lot of people on here and developing on a temporary domain until my domain starts to resolve to my hosting account after changing the DNS settings.
For some reason (possibly security), I have never found a way to get drupal clean urls running on a domain which is based at a temp address, I'm going to try and sus it out though. Will report back if I manage to fix it.
Quick Fix
I am not totally sure on the implications of this, an apache guru could probally say more, but replacing the .htaccess file code with this solved all my problems with clean URLs on Host Gator:
Hope this helps!
Chuck
works
Following chucks last post works fine, please do let us know if there is anything wrong with it but it works perfectly for me
Getting clean URLs to work on a Host gator reseller package using drupal 7, locate the file called .htaccess which is in the public_html file. This is the file where your drupal would have been installed to.
Open the .htaccess file by highlighting it and clicking edit in the menu at the top, then delete what is in that file and replace with:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?q=$1 [L]
Now check the box for clean urls and it will work :)