DIY DOMAINING: Redirect To Another Page Using jQuery or Pure Javascript

The way we redirect a page is entirely related to your number of successful leads. Sometimes a prospect may click on your BuyNow link, and when that happens you would want to ensure that the event of redirecting to another page will not shun the prospect away;  certain methods may literally scare them away.

Links are the #1 cause of many headaches, to name a few: phishing, malware, spamware, et al. That means people are skeptical, sometimes, in clicking on a link. You also want to make sure that the link clearly states that the user will be redirected to another page.

Besides linguistics and clarity, there is another factor on how the redirection is perceived and that is: the method we use to redirect.

There are many ways to redirect a domain and/or its content (webpage):

-DNS A Records. You point the sld.tld to a specific IP. The webserver of that IP should be able to handle the presence of this sld.tld.

-DNS Canonical Name (CNAME). You essentially equate Domain A = Domain B. If you type *.www.domainA.tld/something it should resolve to domainb.tld.

-Webserver. You literally place a link on the webserver’s file system/gateway indicating a new URL and the reason.

Redirects at the DNS level are ultimately faster (if the redirection goes to a different server ) since it knows almost from the get go the destination IP ( without necessarily having to hit the primary server first ). Redirections at the Webserver level usually means that the packet will only know that there is a change of address once he gets to the old address. Webserver redirections can be either 301 ( Moved permanently – Best for SEO ). 302 (Moved temporarily) and Meta refreshes (redirect is executed on the page level rather than the server level, an example of this would be a countdown with a redirect at the end. If you care about SEO, use this one carefully). Avoid using ‘cloaked’ redirect.

The Internet is confusing as it is, people appreciate transparency.

There are a variety of reasons why you would choose one over the other, but for the purpose of this article we will limit the scope in relations to domaining only. Other contexts would require a much lengthier article. Nevertheless, a few of the reasons one would consider the other are:

-SEO. Reputation carrying ( or reputation disassociation ).

-Analytical reasons.

-High traffic distribution architectures (ex: cdns ).

-Legal resons and other reasons.

For the purpose of domaining, the ideal domaining server has its own nameserver, so IP allocation can be subsequently applied within your domaning server just so also you retain the entirety of your traffic. For later lead analysis. Such analysis cannot be achieved with the same precision if you maintain your domains under its registrar’s nameserver. Ideally you would register a domain for the purpose of being your nameserver. This registration should take place at the cloud. Register a domain via Amazon AWS, Google Cloud, or even Microsoft’s Azure. If you ask me, Google cloud surpasses AWS, specially if your server’s purpose is domain investing. Use their DNS services and set up a nameserver with at least 3 ip numbers. Look for the upcoming article on DIY Domaining: How to create a vanity/white label nameserver originating from the cloud within your domaining server. The alternative is to ask your registrar to issue a record of authority to a domain of your choice to be a nameserver. Once you have your nameservers, place all your domains under them. At this point you will be able to control and redirect, either via webserver or via DNS but this time, with the advantage of having total access to your domain traffic. Not to mention the ability of properly setting up reasonable TTLs.

Regardless how you get to this point, here’s how you would do it, in different ways:

Webserver at a global level:


header("Location: https://domainoverflow.com");

exit(1); // important ( remember always: JavaScript can and usually is asynchronous ).
Webserver at either global or domain level (Apache AND Nginx Specific )

//Please look for the upcoming article DIY Domaining: Designing and Implementing a globalrouter for your domaining server.

Webserver at the domain level:

JavaScript using Jquery

$(location).attr("href","https://dotbossdigital.com") ;

Pure JavaScript

window.location.href = "newpage.html";

There are other ways of doing this via webserver level on a more global way and smarter to catch and qualify traffic: for such please look for the upcoming article: DIY Domaining: Designing and Implementing a globalrouter for your domaining server. Also make sure you remove any ads that might be in the way during the event of redirecting to your POS.

For DNS redirection, you can use the same method applied in our previous article: https://domainoverflow.com/index.php/2017/11/01/increasing-the-perspective-of-selling-a-domain-by-using-its-actual-email/



The alternative, of course, is to change your domains to ns1.dotbossdigital.com and ns2.dotbossdigital.com and enjoy the same results as above by simply dragging, dropping and click: it’s done !

It takes 60-seconds to sign up, click here to be redirected to dotboss.digital.


Questions ? Suggestions ?

I hope you will find this useful.

Thanks for reading.




There are no comments yet

Why not be the first

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: