LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-12-2009, 01:43 PM   #1
karnaf
Member
 
Registered: Dec 2005
Distribution: Linux Mint 14 (Cinnamon), Xubuntu 12.04, Ubuntu 10.04
Posts: 49

Rep: Reputation: 15
Managing multiple domains using mod_rewrite in GoDaddy


Hi all,

I've got a basic hosting plan at GoDaddy (which I'm already starting to regret) and I am trying to use it for two domains I have. I'm trying to control which domain will be served using the following .htaccess file located in my html root folder

Code:
RewriteEngine on
Options +FollowSymLinks
DirectoryIndex index.php index.html

RewriteCond %{HTTP_HOST} ^(www.)?myMainSite.com$
RewriteRule ^(.*) myMainSite_com/www/$1 [L]

RewriteCond %{HTTP_HOST} ^dev.myMainSite.com$
RewriteRule ^(.*) myMainSite_com/dev/$1 [L]

RewriteCond %{HTTP_HOST} ^(www.)?myOtherSite.info$
RewriteRule ^(.*) myOtherSite_info/www/$1 [L]

RewriteCond %{HTTP_HOST} ^dev.myOtherSite.info$
RewriteRule ^(.*) myOtherSite_info/dev/$1 [L]
I keep getting a 500 - Internal Server Error page, no matter what I try, and GoDaddy doesn't give me access to the apache log files or the option to create a RewriteLog...

the folders myMainSite_com and myOtherSite_info are folders in my html folder in which the .htaccess is

What am I missing? What am I doing wrong?

Thanks for any help!
karnaf

Last edited by karnaf; 06-12-2009 at 02:39 PM.
 
Old 06-13-2009, 06:43 AM   #2
karnaf
Member
 
Registered: Dec 2005
Distribution: Linux Mint 14 (Cinnamon), Xubuntu 12.04, Ubuntu 10.04
Posts: 49

Original Poster
Rep: Reputation: 15
OK, I've started from scratch after reading the apache.org mod_rewrite specs again and managed to make it work. I think I've realized the mistake I'm made -

Here's the version which works (for now )
Code:
RewriteEngine on
DirectoryIndex index.php index.html

# myMainSite.com
RewriteCond %{REQUEST_URI} !^/myMainSite_com/www/
RewriteCond %{HTTP_HOST} ^(www.)?myMainSite.com$
RewriteRule ^(/)?$ myMainSite_com/www/ [L]

RewriteCond %{REQUEST_URI} !^/myMainSite_com/www/
RewriteCond %{HTTP_HOST} ^(www.)?myMainSite.com$
RewriteRule ^(.*)$ /myMainSite_com/www/$1 [L]

RewriteCond %{REQUEST_URI} !^/myMainSite_com/dev/
RewriteCond %{HTTP_HOST} ^dev.myMainSite.com$
RewriteRule ^(.*)$ /myMainSite_com/dev/$1 [L]

# myOtherSite.info
RewriteCond %{REQUEST_URI} !^/myOtherSite_info/www/
RewriteCond %{HTTP_HOST} ^(www.)?myOtherSite.info$
RewriteRule ^(/)?$ myOtherSite_info/www/ [L]

RewriteCond %{REQUEST_URI} !^/myOtherSite_info/www/
RewriteCond %{HTTP_HOST} ^(www.)?myOtherSite.info$
RewriteRule ^(.*)$ myOtherSite_info/www/$1 [L]

RewriteCond %{REQUEST_URI} !^/myOtherSite_info/dev/
RewriteCond %{HTTP_HOST} ^dev.myOtherSite.info$
RewriteRule ^(.*)$ myOtherSite_info/dev/$1 [L]
Enjoy!
karnaf
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Yikes! My Godaddy VPS is giving me these errors. Can't register, delete domains or kholt Linux - Newbie 1 06-03-2009 09:24 PM
Multiple emails accounts(with different from domains) on multiple domains on 1 server locoputo Linux - Server 0 04-12-2009 07:29 PM
Multiple domains in LDAP and 1 samba server for all domains, what to do? xnomad Linux - Server 1 11-14-2008 10:12 AM
Sub Domains & Multiple Domains (Apache) lugos Linux - Server 1 09-01-2006 11:22 PM
managing different domains with postfix jules_fraser Linux - Networking 1 12-23-2003 12:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration