Forum Moderators: phranque

Message Too Old, No Replies

redirect parked domain to a folder on hosted domain

         

bluesman13

7:36 pm on Mar 21, 2006 (gmt 0)

10+ Year Member



Hello,

I'm a newbie, so please excuse my ignorance.

I have a parked domain pointing to a hosted site on the same ISP. I would like to have the parked domain go directly to a folder on the hosted site. I was going to add a php script to the index page, but this would create many broken links throughout the site. So, I'm trying to do this throught the htaccess file.

Putting this on the htaccess on the hosted site doesn't seem to work:
(parked domain is already pointed to hosted domain)

Redirect [parked_domain.info...] /target_folder_on_hosted_site/folder.html

Any ideas or suggestions? thanks in advance.

jdMorgan

9:01 pm on Mar 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



"Parked domain" is a relatively nebulous term, but you'll need to point that domain to a server and then put code on that domain to redirect it. With your host's approval/cooperation, you could host both sites in the same account of the same server, and then use either a 'control panel' or mod_rewrite to sort the two domains into two different subdirectories so you can keep their files separate.

Jim

bluesman13

9:21 pm on Mar 21, 2006 (gmt 0)

10+ Year Member



Hi jim,

thanks for the response. What they are calling "parked" means that we registered the domain and I've set a pointer for our hosted domain to appear when they enter the parked domain's url. ok. so, I tried adding the code above to the htaccess file to no avail. I was hoping for someone to share a piece of code similar to the code I saw here when I searched the library using redirect as the keyword. I'm trying to edit the htaccess file so that www.parked_domain.info (already pointed to hosted-domain.com) results in www.hosted_domain.com/folder/file.html. First off, I'm trying to determine if it's possible to do this. then, if someone would be kind enough to share the code to do it.

thanks again...

jdMorgan

10:35 pm on Mar 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Assuming that you have already configured working mod_rewrite code in the top-level directory of hosted-domain.com, then adding the following will do what you specified:

RewriteCond %{HTTP_HOST} ^www\.parked_domain\.info
RewriteRule (.*) /folder/$1 [L]

This rule takes effect only if a file in parked-domain is requested, and won't affect requests to hosted-domain.

For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].

Jim

bluesman13

2:42 pm on Mar 22, 2006 (gmt 0)

10+ Year Member



Jim,
thanks for your response. Using the code you wrote with what I think you meant as "configuring mod_rewrite", I've come up with:

Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.parked_domain\.info
RewriteRule (.*) /folder/$1 [L]

Am I getting closer?
I'm assuming that this goes into htaccess?

thanks again,
Steve

jdMorgan

3:44 pm on Mar 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> Am I getting closer?

Yes, it looks like it.

> I'm assuming that this goes into htaccess?

Yes, in the .htaccess file in whatever directory the parked domain is pointed to on your server. Please test it and let us know what the results are.

Jim

bluesman13

4:13 pm on Mar 22, 2006 (gmt 0)

10+ Year Member



Hi Jim,
when I insert this into .htaccess:

Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.parked_domain\.info
RewriteRule (.*) /folder/file/.hmtl/$1 [L]

I got a "http 500 internal server error". Note: I added the "file/.hmtl/" to the last line to point to the file I wanted to load.

thanks,
Steve

bluesman13

4:45 pm on Mar 22, 2006 (gmt 0)

10+ Year Member



Edit:
just as a update, I tried changing file/.hmtl/ to file\.html thinking that I had mixed them up. For the parked domain, I got a different error message an "500 Internal server error" (note: no http) but the hosted domain name gave the same error as before - an "http 500 internal server error".

bluesman13

5:25 pm on Mar 22, 2006 (gmt 0)

10+ Year Member



Jim,

thanks for your help. I just spoke the tech support folks at Earthlink and they're telling me that mod_rewrite can't (won't?) be enabled on websites hosted with them. So, as this closes this thread, please accept my thanks for your help and sorry I didn't check that out sooner.

Steve