zack
Intern
Intern
  • UID5200
  • Fans0
  • Follows0
  • Posts1
Reads:799Replies:3

How to set domain A direct to domain B

Created#
More Posted time:Feb 21, 2018 13:38 PM
I want to direct domain A to domain B, so when use domain A, it goes to domain B website,
I dont know how to set up in Alibaba

hanneng
Assistant Engineer
Assistant Engineer
  • UID3277
  • Fans3
  • Follows0
  • Posts52
1st Reply#
Posted time:Feb 22, 2018 13:34 PM
Hi Zack


Can you share a bit more on your setup?
There are few ways to do.
Firstly, we need to understand how is your setup, using Apache or NGINX.

GhulamQadir
Engineer
Engineer
  • UID5968
  • Fans2
  • Follows0
  • Posts70
2nd Reply#
Posted time:Jul 23, 2018 6:58 AM
@zack. There are few ways to redirect one domain to another:

1. web redirect with cPanel?
You can create different types of web redirects from your cPanel -> Redirects in the Domains box. The redirections can be Temporary and Permanent.

Temporary redirects (as the name suggests) are not permanent redirects, which means that the page is sending status code 302 to the browser. The 302 code tells the browser not to save this redirect into its cached data. This is the recommended type of redirect unless you are absolutely sure that you will never change it in the future.

Permanent redirects have a status code of 301 and unlike the temporal ones are cached in the browser memory. 301 redirects are permanent. They mean that the page has moved and they request any search engine or user agent coming to the page to update the URL in their database.

You can also use the tool to create Wildcard redirects. These redirect all of the files in a directory to the same filename in the redirected directory. Note that if you create a Wildcard redirect for a given folder, all other redirects will be automatically removed by the cPanel tool to avoid interference.



2. PHP and HTML redirects
If you do not wish to use the .htaccess file to redirect your visitors, you can use another option - a PHP or an HTML file which will perform the actual redirection. Below are examples for both programming languages:


For PHP, create a file (index.php for example) in the document root folder of your domain and add the following lines in it:



<?php
header( 'Location: http://www.yoursite.com/redirect_location' ) ;
?>


For HTML, create a file (index.html for example) with the following content:


<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://www.yoursite.com/redirect_location">
Here you have the option to delay the redirect by increasing the CONTENT variable. For example CONTENT=5 will delay the redirect for 5 seconds.

BrianBae
Assistant Engineer
Assistant Engineer
  • UID5909
  • Fans0
  • Follows0
  • Posts58
3rd Reply#
Posted time:Jul 23, 2018 15:02 PM
1. Use domain provider.
   => They provide domain redirect service with a cheap price(Easy way)
  It use only DNS Server you don't need active source domain hosting.

2. Use Apache Web Server
<VirtualHost *:80>
    ServerName abc.example.com
    RedirectPermanent / http://xyz.example.com/
    # optionally add an AccessLog directive for
    # logging the requests and do some statistics
</VirtualHost>

abc.example.com muse be alive for redirection.


I recommend you  use domain redirect service through domain provider(more easy and safe)
Guest