URL redirection for web hosting

  • aung
  • Born
  • Born
  • aung
  • Posts: 2

Post 3+ Months Ago

Hello,

Suppose we have domain name called "my" (sorry I can't insert the fully qualied domain name in here as it give me error) and it has been hosting long time. Visitors normally visit to "my". It is hosting with ISP called A.

We want to create another domain name called "sample" and to redirect all web traffic from "my" to "sample". But, "sample" will be hosted with ISP called B. I’d like to know whether it is possible? If possible, I like to know the steps to be accomplished.

If we want to redirect all web traffic from "my" to "sample/my/", whether it is also possible. If possible, I also like to know the steps that need to be accomplished.

Thanks.
Aung
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

If I understand your query correctly, then indeed it is possible.

There's actually a number of ways to do it depending upon how much control you have and how clean you want the implementation to be. I will start with the cleanest.

1. Presuming you have your DNS maintained elsewhere than your two hosts (always a good idea) simply add the zone for domain A to the record for domain B. Now the same zone is authoritative for both domains. Add a redirect rule to your web config that any request for my go to sample/my/ .

2. Presuming you do not have third party control over your DNS (tsk tsk), you can add a subdomain on the sample server, call it my.sample.com. Then on domain A (my) you cname in DNS www -> my.sample.com. Any request now for http://www.my.com will go to my.sample.com. In your IHS config you create a virtual host for my.sample.com and either host your content there, or redirect any request to that URI to sample.com/my

3. Presuming I have completely lost you and you have no idea what DNS is, place a redirect on your MY site (preferably via web server config, but if you absolutely have to, via javascript on content) to your sample/my/ content tree.

I am sure there's more.... just limited by your imagination really.
  • aung
  • Born
  • Born
  • aung
  • Posts: 2

Post 3+ Months Ago

Hello,

Thank you for your answer. I will describe more details on this time so that you’d understand more clearly about my question.

There is a domain called www(dot)my(dot)com and I don’t have authorization for its DNS zone and record. Visitors usually visit to that domain and web contents are there.

However, our firm own domain called www(dot)sample(dot)com and I have fully control over its DNS zone and records, i.e. I can create records for “sample(dot)com” zone. We are hosting www(dot)sample(dot)com with Microsoft IIS.

Now, I like to redirect web traffic from www(dot)my(dot)com to www(dot)sample(dot)com/my/. Please note that “my” is just virtual directory under www(dot)sample(dot)com and there is no web contents with it. Would that be possible? If possible, could you advice?

Thank you.
Aung
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9090
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

You could always just do a 301 or 302 redirect to the other website. This would not be on the DNS level though, this would be via your HTTP web server. If you are using Apache as your web server, you could easily do this via .htaccess files. For example:

Code: [ Select ]
# This allows you to redirect your entire website to any other domain
Redirect 301 / http://www.sample.com/my/
  1. # This allows you to redirect your entire website to any other domain
  2. Redirect 301 / http://www.sample.com/my/
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

Yah, 301/302 at the server layer is better than javascript.
Put that in between 2 and 3. :) So 2.5.
  • paullopez
  • Born
  • Born
  • paullopez
  • Posts: 3

Post 3+ Months Ago

As you wish to redirect all the urls from one site to another site’s url, then you will have to use rewrite rules in .htaccess files. Just remember you have to include .htaccess rules into my[dot]com. Means when someone access the url my[dot]com/anything it will redirected to sample[dot]com.
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

Actually, as was pointed out, there's many ways to do it, not .htaccess. IN fact I would recommend NOT using .htaccess as a point of order. Enabling htaccess can impact the system.
  • googlecentos
  • Born
  • Born
  • googlecentos
  • Posts: 4
  • Loc: usa

Post 3+ Months Ago

htaccess is the simply way:

To Redirect Certain Page(s):

Redirect 301 /oldpage.html http://yoursite/newpage.html
Redirect 301 /oldpage2.html http://yoursite/folder/

To Redirect Entire Site:

Redirect 301 / http://new-site/

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 14 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.