Forum Moderators: phranque

Message Too Old, No Replies

How to redirect site to another site and keep domain name

         

Hugene

1:30 am on Dec 14, 2007 (gmt 0)

10+ Year Member



Hello everyone

I have a site that generates almost no trafic and no revenue (lest called it www.widget.com). But it has a good G SERP position.

The cost of hosting it is over what it makes, so I should close it.

But I was wondering if it is possible to do something else instead:

1) get rid of the domain hosting (saves the $)
2) change the DNS associated to www.widget.com to point to www.new_widget.com
3) have a subdirectory, called in www.new_widget.com/widget that contains all the content of www.widget.com
4) do some-kind of url redirect such that requests for www.widget.com always show the domain www.widget.com in the URL, but yet are really only fetching content from www.new_widget.com/widget

that way I dont have to pay buy full hosting for www.widget.com but the site will still 'exist' hoested on another domain

is that possible, and how would I go about to implement point (4)

thank you

jdMorgan

3:46 am on Dec 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Once all the content is on the same server, you don't use an external redirect, you use an internal rewrite. This does not involve the client, so the browser address bar does not change.

You can change the DNS to point to the new_widget server, but there's one more step between that and the rewrite: The server itself must be configured to 'know' that old_widget requests should be sent to the new_widget filespace. Some hosts support this with an 'add-on domain' in the control panel, others will set it up for a one-time fee, and others won't let you do it at all.

Jim

Hugene

8:25 pm on Dec 14, 2007 (gmt 0)

10+ Year Member



Thanks,

How do I request for the server to know about the new file space for new_widget? What is the name of this manipulation?

As for the internal rewrite, is this the re-write rules that I put in .httpacess file, and which will say something of the sort:

www.old_widget.com rewrite to www.new_widget.com/old_widget

will that change the url that is displayed on the client?

Hugene

11:30 pm on Dec 15, 2007 (gmt 0)

10+ Year Member



Hello,

By internal re-write, do you mean using the mod_rewrite module?

thanks

jdMorgan

4:19 pm on Dec 16, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, once everything else is configured, you can use mod_rewrite (if necessary) to rewrite requests for your add-on domain to a subdirectory in your main domain's "account," where you can store the content for the add-on domain.

This search [google.com] will turn up several past threads on the subject, and may prove useful for your research.

Jim

Hugene

9:08 pm on Dec 17, 2007 (gmt 0)

10+ Year Member



Thanks Jim,

I started reading the posts, seems like most people are interested in rewriting directory content to sub-domains, whereas I want to keep the domain the same (www.old_widget.com), but make it fetch the content from a directory like www.new_widget.com/old_widget_content.

Can mod_rewrite allow me to implement this? I would assume so. I guess I have to write a rule that states:

all requests for www.old_widget.com use directory /<unix path>/http/old_widget_content

jdMorgan

9:32 pm on Dec 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There is no practical difference between rewriting a subdomain request to a directory, and rewriting a different-domain request to a subdirectory. The solution is identical.

Jim

g1smd

11:51 pm on Dec 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



A friend of mine has a small website of only a few dozen pages, but the hosting plan that he has allows space for many thousands more files, and a thousand-fold increase in traffic. It seemed a waste to have that much available.

He now hosts small websites for several local businesses, on the same plan. I guess there are now about 15 sites all sharing the same space. The various rewrite and redirect rules ensure that they are all kept separate.

ATLSoftwareEngineer

6:07 am on Dec 21, 2007 (gmt 0)

10+ Year Member



Hi Hugene,

I actually went through exactly what you were wondering. My buddy just told me about his hosting company that allows you to have up to 25 domains, and point them all to one hosting service, allowing you to show the domain name you want, while masking where it is pointed within the subdirectories of the host service you have. I forget the name but my buddy has a banner on his site at <snip> that tells a little about it with a link.

So lets say you have the widgets.com domain and and want to point it to existingwebsite.com/newwidgets you can host the files on the existing hosting service you have and no one would know the difference.

You don't have to write any code because the hosting company does it for you. just a few clicks and you're set to go. Much easier than writing the htaaccess code.

Good luck

[edited by: jdMorgan at 6:15 am (utc) on Dec. 21, 2007]
[edit reason] No URLs, please. See Terms of Service. [/edit]