Join the community today
Register Now

Domains Usage of a Short Domain

Discussion in 'Domains, DNS, Email & SSL Certificates' started by Jimmy, Jun 7, 2016.

  1. Jimmy

    Jimmy Premium Member Premium Member

    1,165
    256
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +626
    Local Time:
    11:45 AM
    1.13.x
    MariaDB 10.1.x
    I have a domain lets call it, hairballforum.com and it's pretty long but perfect for my website.

    I want to keep my main site on hairballforum.com because it's perfect for my niche, but I want to use a shorter name to make it easier for my members and others who want to spread a link on twitter or somewhere else online. So, I go out an buy hb.fyi which would be my short domain.

    I believe I can setup a redirect in nginx to point any requests like hairballforum.com/this-is-a-thread-on-the-forum/ so that when someone types in hb.fyi/this-is-a-thread-on-the-forum/ it will go to hairballforum.com/this-is-a-thread-on-the-forum/ using what is below.

    Code:
    server {
        listen 80;
        listen 443 ssl;
        server_name www.hb.fyi;
        return 301 $scheme://www.hairballforum.com$request_uri;
    }
    *not exactly sure which redirection status code would be the best to use, so I used 301 in this example.

    Has anyone ever done this? There is one site I know of that uses XX.xx but it only redirects to their main site even if the link is XX.xx/something-something-else/

    Would this be the best way or are there services out there that I can use with my new domain?

    How would this impact SEO for the main domain?
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,945
    6,914
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,411
    Local Time:
    2:45 AM
    Nginx 1.13.x
    MariaDB 5.5
    why not just park the domain on top of hairballforum.com ? edit nginx vhost for hairballforum.com.conf and add
    www.hb.fyi and hb.fyi to the space separated list for server_name and restart nginx
     
  3. Jimmy

    Jimmy Premium Member Premium Member

    1,165
    256
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +626
    Local Time:
    11:45 AM
    1.13.x
    MariaDB 10.1.x
    That's a great idea. Never thought of that.

    Question: won't adding hb.fyi to the space separated list allow the domain to show up as hb.fyi? I want anyone entering hb.fyi to be directed to hairballforum.com so that shows as the link.
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,945
    6,914
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,411
    Local Time:
    2:45 AM
    Nginx 1.13.x
    MariaDB 5.5
    oh then yes your original 301 or 302 redirect is needed heh
     
    • Like Like x 1
  5. Jimmy

    Jimmy Premium Member Premium Member

    1,165
    256
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +626
    Local Time:
    11:45 AM
    1.13.x
    MariaDB 10.1.x
    Thanks @eva2000 for the info. It's good to know that I can add another domain to the list and have it appear as the domain. Though, I wonder how having 2 domains would effect Google rankings? Would both appear in the rankings or would Google penalize?
     
  6. eva2000

    eva2000 Administrator Staff Member

    30,945
    6,914
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,411
    Local Time:
    2:45 AM
    Nginx 1.13.x
    MariaDB 5.5
    need a canonical header to point the domain alias/parked domains to the real domain. I do that with centmin.com and centmin.sh with canonical header to centminmod.com
    Code (Text):
    curl -sI http://centmin.sh | grep canonical
    Link: <http://centminmod.com/>; rel="canonical"
    
    curl -sI https://centmin.sh | grep canonical
    Link: <http://centminmod.com/>; rel="canonical"

    Code (Text):
    curl -sI http://centmin.com | grep canonical 
    Link: <http://centminmod.com/>; rel="canonical"
    
    curl -sI https://centmin.com | grep canonical
    Link: <http://centminmod.com/>; rel="canonical"

    In centminmod.com nginx vhost
    Code (Text):
    add_header Link "<http://centminmod.com$request_uri>; rel=\"canonical\"";

    so
    Code (Text):
    curl -sI http://centmin.sh/news.html | grep canonical    
    Link: <http://centminmod.com/news.html>; rel="canonical"
    
     
    • Informative Informative x 1
  7. Jimmy

    Jimmy Premium Member Premium Member

    1,165
    256
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +626
    Local Time:
    11:45 AM
    1.13.x
    MariaDB 10.1.x
    If I used what is below and a person came via the hb.fyi link, would it be tracked in Google Analytics? How is the tracking affected when you do something like below? I'm not a pro at Google Analytics, but would I have to setup another domain in Analytics to track that domain?

    Code:
    add_header Link "<http://hb.fyi$request_uri>; rel=\"canonical\"";
     
  8. eva2000

    eva2000 Administrator Staff Member

    30,945
    6,914
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,411
    Local Time:
    2:45 AM
    Nginx 1.13.x
    MariaDB 5.5
    There's nothing tracked by GA for canonical header links
     
    • Informative Informative x 1
  9. YuchiRO

    YuchiRO Member

    93
    6
    8
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    11:45 PM
    5.5.4
    Hi

    I added park domain on servername like

    I want redirect to new domain (xyz.com) when visitor visit old domain (abc.com)
    But i get error xyz.com redirected you too many times.

    Both domain not working.
     
  10. Jimmy

    Jimmy Premium Member Premium Member

    1,165
    256
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +626
    Local Time:
    11:45 AM
    1.13.x
    MariaDB 10.1.x
    You might need the ports like I have it in the OP.

    Also, make sure to restart Nginx after the change.

    Code:
    server {
        listen 80;
        listen 443 ssl;
        server_name www.hb.fyi;
        return 301 $scheme://www.hairballforum.com$request_uri;
    }
     
    • Informative Informative x 1
  11. eva2000

    eva2000 Administrator Staff Member

    30,945
    6,914
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,411
    Local Time:
    2:45 AM
    Nginx 1.13.x
    MariaDB 5.5
    @YuchiRO you need 2 separate server{} contexts if you want redirect only and not parked domain, one for the redirect and one for the original main domain so DO NOT park all domains under one server_name line in 1 server{} context
     
    • Agree Agree x 1
  12. YuchiRO

    YuchiRO Member

    93
    6
    8
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    11:45 PM
    5.5.4
    Hi

    I try with 2 server conext but still not working for new domain.

    I want to deliver traffic from old domain to new domain and use same resource/data web instead of create/clone current data to new domain. I dont know what it's call (parked+redirect) ?

    Ex: When visitor visit abc.com/this-is-ex-01 redirect to xyz.com/this-is-ex-01

    So, is this possible ?
     
  13. Jimmy

    Jimmy Premium Member Premium Member

    1,165
    256
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +626
    Local Time:
    11:45 AM
    1.13.x
    MariaDB 10.1.x
    Post the server blocks you're using so we can see what you're doing.
     
  14. eva2000

    eva2000 Administrator Staff Member

    30,945
    6,914
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,411
    Local Time:
    2:45 AM
    Nginx 1.13.x
    MariaDB 5.5
    then you don't need redirect you just park like originally without redirect
    Code (Text):
    server {
    server_name abc.com xyz.com;

    And for SEO setup canonical header link Domains - Usage of a Short Domain | Centmin Mod Community pointing to main domain you want google to index
     
  15. YuchiRO

    YuchiRO Member

    93
    6
    8
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    11:45 PM
    5.5.4
    i edit my vhost config file as your suggest and change wordpress setting site url to xyz.com.

    When i go to abc.com >> site become xyz.com .. that's great but visit abc.com/simple-1 wont redirect to xyz.com/simple-1
     
  16. eva2000

    eva2000 Administrator Staff Member

    30,945
    6,914
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,411
    Local Time:
    2:45 AM
    Nginx 1.13.x
    MariaDB 5.5
    When you create a new nginx vhost domain via centmin.sh menu option 2 or menu option 22 or via /usr/bin/nv cli command line, you will create the Nginx vhost files and directories. You will get an outputted the path location where it will create the domain name's vhost conf file named newdomain.com.conf (and newdomain.com.ssl.conf if you selected yes to self signed SSL)
    • Nginx vhost conf path will be at /usr/local/nginx/conf/conf.d/newdomain.com.conf
    • Nginx HTTP/2 SSL vhost conf path will be at /usr/local/nginx/conf/conf.d/newdomain.com.ssl.conf
    • Nginx Self-Signed SSL Certificate Directory at /usr/local/nginx/conf/ssl/newdomain.com
    • Vhost public web root will be at /home/nginx/domains/newdomain.com/public
    • Vhost log directory will be at /home/nginx/domains/newdomain.com/log
    Please post the contents of /usr/local/nginx/conf/conf.d/newdomain.com.conf and if applicable /usr/local/nginx/conf/conf.d/newdomain.com.ssl.conf wrapped in CODE tags (outlined at How to use forum BBCODE code tags)
     
  17. YuchiRO

    YuchiRO Member

    93
    6
    8
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    11:45 PM
    5.5.4
    Hi

    If i use opition 2 or 22 to create new vhost (xyz.com), do i need copy resources from old domain (abc.com) to new domain folder ?
    If yes, i have 2 same site with different domain and i need redirect from old domain to new domain site. That's look like simple but cost more time for me.

    Anyway to do my request without duplicate web resource to save time ?

    Regards
     
  18. eva2000

    eva2000 Administrator Staff Member

    30,945
    6,914
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,411
    Local Time:
    2:45 AM
    Nginx 1.13.x
    MariaDB 5.5
    for parked domains you don't need to run centmin.sh menu option 2 or 22, just edit existing main domain's nginx vhost's server_name line to add the parked domain. If you had ran centmin.sh menu option 2 or 22, then you will have issues as you would have server_name for the new vhost + the existing main domain's vhost server_name.

    just delete the parked domain's nginx vhost created via centmin.sh menu option 2 or 22 as outlined at Nginx Vhost & NSD DNS Setup - CentminMod.com LEMP Nginx web stack for CentOS if the data in that vhost is disposable
     
  19. YuchiRO

    YuchiRO Member

    93
    6
    8
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    11:45 PM
    5.5.4
    At this time i just edit old domain config file server_name only by added new_domain name.

    So, what's i need to do next ?

    I need to config

    (*) type abc.com >> redirect to xyz.com (working). My site is wordpress.
    (*) But when i visit link like abc.com/this-is-link-but-not-working this link still abc.com instead of xyz.com/this-is-link-but-not-working

    I need to do that because old domain has traffic but newdomain just create.

    Regards
     
  20. YuchiRO

    YuchiRO Member

    93
    6
    8
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    11:45 PM
    5.5.4
    At this time i just edit old domain config file server_name only by added new_domain name.

    So, what's i need to do next ?

    I need to config

    (*) type abc.com >> redirect to xyz.com (working). My site is wordpress.
    (*) But when i visit link like abc.com/this-is-link-but-not-working this link still abc.com instead of xyz.com/this-is-link-but-not-working

    I need to do that because old domain has traffic but newdomain just create.

    Regards