Go Back   HostGator Peer Support Forums > HostGator Peer Support Forums > Shared Hosting Support

Notices

Reply
 
Thread Tools
  #1  
Old 08-20-2008, 12:54 AM
douglerner douglerner is offline
Hatchling Croc
 
Join Date: Aug 2008
Posts: 4
Default Issue with .htaccess and rewrite - any ideas

My primary domain is elliptics.com. For now, I want URLs to http://www.elliptics.com and http://elliptics.com to get automatically sent to my Drupal instance at http://www.elliptics.com/drupal.

So, I modified the root level .htaccess file as follows:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mail(.*)$ [NC]
RewriteRule ^(.*)$ %{REQUEST_URI}/webmail [R=301,L]

RewriteCond %{HTTP_HOST} ^elliptics.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.elliptics.com$
RewriteRule ^(.*)$ http://www.elliptics.com/drupal [R=301,L]

That works as far as the root level elliptics.com URLs go, but some other URLs that should not get sent to Drupal are getting sent there.

For example, while http://elliptics.com/elgg correctly goes to the elgg instance, http://elliptics.com/gallery and http://elliptics.com/moodle don't go to those folders and instead get sent to the drupal folder.

Anybody have any idea why?

Thanks!

doug
Reply With Quote
  #2  
Old 08-23-2008, 08:56 PM
douglerner douglerner is offline
Hatchling Croc
 
Join Date: Aug 2008
Posts: 4
Default Re: Issue with .htaccess and rewrite - any ideas

I guess nobody else has run into this kind of problem?

doug
Reply With Quote
  #3  
Old 08-23-2008, 10:20 PM
cordoba11 cordoba11 is offline
Hatchling Croc
 
Join Date: Nov 2007
Posts: 26
Default Re: Issue with .htaccess and rewrite - any ideas

Quote:
Originally Posted by douglerner View Post
My primary domain is elliptics.com. For now, I want URLs to http://www.elliptics.com and http://elliptics.com to get automatically sent to my Drupal instance at http://www.elliptics.com/drupal.

So, I modified the root level .htaccess file as follows:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mail(.*)$ [NC]
RewriteRule ^(.*)$ %{REQUEST_URI}/webmail [R=301,L]

RewriteCond %{HTTP_HOST} ^elliptics.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.elliptics.com$
RewriteRule ^(.*)$ http://www.elliptics.com/drupal [R=301,L]

That works as far as the root level elliptics.com URLs go, but some other URLs that should not get sent to Drupal are getting sent there.

For example, while http://elliptics.com/elgg correctly goes to the elgg instance, http://elliptics.com/gallery and http://elliptics.com/moodle don't go to those folders and instead get sent to the drupal folder.

Anybody have any idea why?

Thanks!

doug

hmmm
why dont you just move drupal to your main directory??
did you install from fantastico??
do a backup of the db and do a reinstall than restore backup
in fantastico instead of filling the info where it ask you for the file location just leave empty and it will install in public_html

Last edited by cordoba11; 08-23-2008 at 10:23 PM.
Reply With Quote
  #4  
Old 08-23-2008, 10:25 PM
douglerner douglerner is offline
Hatchling Croc
 
Join Date: Aug 2008
Posts: 4
Default Re: Issue with .htaccess and rewrite - any ideas

Thanks for your reply.

I did install from cPanel.

I have lots of other things in the main directory too, not to mention various other domain folders. So I wanted to keep this in the drupal folder.

It would be way way way too cluttered and confusing with everything if I put all the drupal contents directly at the top level.

That rewrite set should work, right? Or do I have a mistake in syntax?

Thanks,

doug
Reply With Quote
  #5  
Old 10-10-2008, 01:10 PM
promni promni is offline
Hatchling Croc
 
Join Date: Jun 2008
Posts: 12
Default Re: Issue with .htaccess and rewrite - any ideas

You could just setup a redirect?
Reply With Quote
  #6  
Old 10-10-2008, 07:04 PM
douglerner douglerner is offline
Hatchling Croc
 
Join Date: Aug 2008
Posts: 4
Default Re: Issue with .htaccess and rewrite - any ideas

Thanks for your note. I actually got the rewrite rule to work. I don't know why my original version, above, didn't work, but this one does:

RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^/?$ "http\:\/\/www\.elliptics\.com\/drupal" [R=302,L]

RewriteCond %{HTTP_HOST} ^www\.\elliptics\.com$
RewriteRule ^/?$ "http\:\/\/www\.elliptics\.com\/drupal" [R=302,L]

doug
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mod rewrite issue mr_bill Pre-Sales Questions 5 05-12-2008 07:07 AM
.htaccess issue polarisdigital Shared Hosting Support 10 03-21-2008 08:10 AM
rewrite / .htaccess problem gobezu Shared Hosting Support 1 03-18-2007 12:24 PM
.htaccess and mod rewrite texanweb Shared Hosting Support 10 04-24-2006 04:43 PM

All times are GMT -5. The time now is 09:27 AM.