Web Hosting Forum | Lunarpages
News: Server Migrations to San Diego: Deneb, Felix and Tsohea are moving to San Diego starting Tuesday, December 30, 2008 at 10pm Pacific. They will complete their moves Friday night, January 2, 2009

Isis, Seth and Ez-web-n-mail will move physically on Friday, January 2, 2009

Please see the forum posts at http://www.lunarforums.com/lunarpages_web_hosting_server_information-b54.0/

+ Submit Your Own Web Site for the January 2009 Site of the Month Contest!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
January 07, 2009, 07:58:12 PM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: Parked Domain/Addon Domain  (Read 173 times)
Legend
Trekkie
**
Offline Offline

Posts: 18


« on: July 03, 2008, 01:27:58 PM »

Hi,

I'm trying to add a parked domain but for some reason, it is not working. What I am trying to do is this: My primary domain is primarydomain.com But I have another side project running with the domain secondarydomain.com. Recently I have purchased another domain secondarydomain.org but when I try to add it as a parked domain it adds on top of primarydomain.com and not secondarydomain.com. So I tried adding it as an addon domain but it does not work for some reason. I tried using .htaccess but it is not working either. Could you help me out please?

What I want to achieve: Add secondarydomain.org such that it shows the content of secondarydomain.com but still retains the address in the address bar.

Thanks
Logged
Mitch
Lunarpages Traffic Cop
Senior Moderator
Berserker Poster
*****
Offline Offline

Posts: 8934



WWW
« Reply #1 on: July 03, 2008, 01:38:32 PM »

We don't officially support parked domain names for addon domains at this time.  If there is a work around though, I'll leave this thread open so somebody can suggest it to you.  Thanks!
Logged

Foolish Mitch the Moderator

+ Important Threads and Posts: Read This Before Posting! | Lunarforums Rules!
+ Lunarforums Fun: Submit Your URL to or Vote for the Site of the Month!

Also, be sure to check out and subscribe to the Lunartics Blog and the Lunarpages Newsletter !
Legend
Trekkie
**
Offline Offline

Posts: 18


« Reply #2 on: July 03, 2008, 01:43:03 PM »

Oh in that case, how about this... I would add secondaydomain.com as an add-on domain and secondarydomain.org as another add-on domain and will use htaccess to redirect to secondarydomain.com with a 302 redirect but still showing secondarydomain.org in the browser address bar. Is that possible?
Logged
Vitalian
Spaceship Navigator
*****
Offline Offline

Posts: 75



« Reply #3 on: July 03, 2008, 03:09:21 PM »

Yeah, I just told improve to do something similar with his site here. Nothing back yet on whether it worked. Modifying the rewrite code for your site:
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} secondarydomain.org [NC]
RewriteRule (.*) http://secondarydomain.com/$1 [R=301,L]

Better to use a 301 (permanent) redirect. Hopefully that works Very Happy
Logged
Legend
Trekkie
**
Offline Offline

Posts: 18


« Reply #4 on: July 03, 2008, 07:39:04 PM »

Thank you. Currently I'm using an almost similar code (I think its the same though) but what I'm looking for is whether it is possible to still retain the url even after the redirect has taken place. Can you shed some light on this?
Logged
Vitalian
Spaceship Navigator
*****
Offline Offline

Posts: 75



« Reply #5 on: July 04, 2008, 02:43:03 AM »

O.o the URL changes? The URL change should happen behind the scenes. That's what the RewriteEngine does. Mind posting your code so I can see what's different?
Logged
Legend
Trekkie
**
Offline Offline

Posts: 18


« Reply #6 on: July 04, 2008, 09:05:38 AM »

Oh... its exactly the same thing as this:

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} secondarydomain.org [NC]
RewriteRule (.*) http://secondarydomain.com/$1 [R=301,L]

I think I got this from one of your other posts a few days back.
Logged
Vitalian
Spaceship Navigator
*****
Offline Offline

Posts: 75



« Reply #7 on: July 04, 2008, 09:32:22 AM »

Hmm, okay. Not a Rewrite expert, so let me try this on my account.
Logged
Vitalian
Spaceship Navigator
*****
Offline Offline

Posts: 75



« Reply #8 on: July 04, 2008, 12:11:32 PM »

Right, I see what's going wrong. R=301 is a permanent redirect which is what I wanted, just without the external redirect. Problem is: if you're using a fully qualified domain name as a rewrite, it does an external redirect anyways.  Crying or Very sad

I think I've tried everything I possibly could on my account to get it to rewrite behind the scenes. Nothing seems to work. That also brings up another thing though. Even if the domain isn't redirected in the first place, they will be directed to the .com after they click on a link. Unless you do something with PHP that grabs the hostname and does some magic with anchors based on it. Or, this little trick:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>Secondarydomain.org</title>
<meta http-equiv="content-type"
content="text/html;charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
</head>

<frameset cols="100%">
<frame src="http://secondarydomain.com/" />
</frameset>
</html>
Tried that on my test site and it worked! It just loads your content in a frameset, but it keeps the same address in the browser Bouncin for Joy Tell me if you have problems
Logged
Legend
Trekkie
**
Offline Offline

Posts: 18


« Reply #9 on: July 04, 2008, 07:53:46 PM »

First of all, thank you so much for taking time in writing and helping me out... Smile I was aware of the iframe solution but I was just curious if there was a workaround using htaccess. I think I'll take your advice and stick to your method for now. Thanks a lot once again!
Logged
Matthew Alan
Galactic Royalty
*****
Offline Offline

Posts: 244


« Reply #10 on: July 04, 2008, 11:12:41 PM »

I do this with a couple domains, and don't have any problems(it can hurt SEO).

If you have secondarydomain.com in the folder /secondary-domain/, go ahead and add-on secondarydomain.org in the same folder, don't do a redirect or anything... This works fine for me...
Logged
Vitalian
Spaceship Navigator
*****
Offline Offline

Posts: 75



« Reply #11 on: July 05, 2008, 03:36:52 AM »

First of all, thank you so much for taking time in writing and helping me out... Smile I was aware of the iframe solution but I was just curious if there was a workaround using htaccess. I think I'll take your advice and stick to your method for now. Thanks a lot once again!

No problem at all. Note that I did use a frameset though. Firefox doesn't always display iframes correctly. Foxy I still keep my eye out for a solution, but as I mentioned before, you would still have the problem of the URL changing once a user clicks on a link.

You could try Raiden32992's solution, but I think you would still have the URL problem ^^
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM