Join the community today
Become a Member

Domains Usage of a Short Domain

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

  1. Jimmy

    Jimmy Well-Known Member

    1,788
    390
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +990
    Local Time:
    2:55 AM
    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

    55,155
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    4:55 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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 Well-Known Member

    1,788
    390
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +990
    Local Time:
    2:55 AM
    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

    55,155
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    4:55 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    oh then yes your original 301 or 302 redirect is needed heh
     
  5. Jimmy

    Jimmy Well-Known Member

    1,788
    390
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +990
    Local Time:
    2:55 AM
    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

    55,155
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    4:55 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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"
    
     
  7. Jimmy

    Jimmy Well-Known Member

    1,788
    390
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +990
    Local Time:
    2:55 AM
    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

    55,155
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    4:55 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    There's nothing tracked by GA for canonical header links
     
  9. YuchiRO

    YuchiRO Member

    100
    6
    18
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    1:55 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 Well-Known Member

    1,788
    390
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +990
    Local Time:
    2:55 AM
    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;
    }
     
  11. eva2000

    eva2000 Administrator Staff Member

    55,155
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    4:55 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    @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
     
  12. YuchiRO

    YuchiRO Member

    100
    6
    18
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    1:55 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 Well-Known Member

    1,788
    390
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +990
    Local Time:
    2:55 AM
    Post the server blocks you're using so we can see what you're doing.
     
  14. eva2000

    eva2000 Administrator Staff Member

    55,155
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    4:55 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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

    100
    6
    18
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    1:55 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

    55,155
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    4:55 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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

    100
    6
    18
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    1:55 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

    55,155
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    4:55 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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

    100
    6
    18
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    1:55 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

    100
    6
    18
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    1:55 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