Website going down intermittenty, but server is always up - web

I have recently set up my domain, but my problem is when I navigate with/without www, the results are inconsistent. They are supposed to point to the same page, but sometimes, the www site has broken links to non-www components (e.g.: when I load http://www.my-domain.com, and if I have a resource referred as http://my-domain.com/navi.css, it breaks)
Have tried 301 rewriting, but it's not always consistent. What do I need to do to ensure 100% uptime for my site?

This could be because of a couple of reasons:
Your DNS has not propagated yet, meaning if you recently just changed DNS on the domain name give it up to 48 hours and flush cache from your browser.
The domain DNS is pointing to different IP addresses from your www. or * A records.
There is a problem with the hosting configuration (unlikely if you are using CPanel or any hosting control panel as this is mostly automated).
Also you should pick either with or without www for consistency and better SEO results. Pick one and stick to it.

Related

301 Redirect Best Practices - multiple sites to single site

I have around 15+ sites, and we want to drop these sites and merge them into only one site (create pages for each one in the new site).
The 15+ site's domains should be redirected to one site as below:
a.com -> z.com/a
b.com -> z.com/b
c.com -> z.com/c
..
Also, we want to redirect (301) page by page from the old domains to the new the new domain to keep the page's ranking:
a.com/about-us -> z.com/a/about-us
b.com/about/abouus -> z.com/b/about-s
c.com/contactus -> z.com/c/contact-us
Each one of the 15+ sites is running on its own server with a different platform while the new server is IIS.
Currently, I'm thinking of two approaches:
Point the old DNS records to the new server of z.com, and handle all the redirects on the server.
Keep the old site running, and configure redirect rules on each server to redirect each page to the matching page on the new site.
Which approach is better, any other approaches? So far I think the first approach is better since we will control all the redirects in one place - but from the performance wise, is it going to add more headache on the server?
The Scenario
You created a new site and you want to redirect all old sites(15+) to new site (page to page).
All old sites are running in it's own server on different platforms whereas the new one is IIS.
Your options
Point the old DNS records to the new server of z.com, and handle all the redirects on the server.
Advantage
Less cost - you can remove all old sites and the server cost can be saved.
Internal redirection. So, time will be less
Disadvantage
Complex to perform
take care of conflict of similar pages(double check the redirection path)
Keep the old site running, and configure redirect rules on each server to redirect each page to the matching page on the new site
If you can afford the cost of running 15 different sites on 15 servers just to redirect, then only go for this method.
It is just a waste of money and the redirection time will be more.
I think eventually you'll have to shutdown all the other sites as in the long term unlikely does it make sense to keep 15 sites running just to do the redirects.
So as I understand the question is rather on how to better organize the migration to the new system in the short term. So here are my thoughts on this:
how huge is your system
what's your QPS?
how many pages do you have across your sites farm?
do you need to remap URLS for a decent amount of pages?
what's the migration procedure? Will you switch your sites one-by-one or it's technically infeasible and they all need to be swtiched over at once?
If we're talking about a system handling 10 QPS and 1K pages or about a system handling
50K QPS and having 1B pages we need to dynamically remap system load may be a concern and p.2 may look better
rollbacks
note that DNS records can be cached by intermediate servers and if you need to quickly rollback to the previous version if something goes wrong it can be an issue
what kind of systems do you have
Is it actually possible to easily extract URLs from 15 diverse systems and put them to a single point without a risk to lose something valuable?
ease of maintenance
At first glance the first approach looks easier from the maintenance perspective, but I don't know what kind of system you use and how complex the redirection rules need to be.
If they are complex dynamic ones like a.com/product.php?id=1 => z.com/a/iPhone6S moving millions of such urls to a single point could be tricky
SEO
I don't follow the industry closely, but a few years ago both would work ok. I think it's worth consulting those keeping up to date with this industry - it changes very rapidly
Your first approach is definitely the best.
It is easy to maintain
You needn't to keep old infrastructure (though in your second case you'll need to keep only redirecting frontend like apache, nginx or lighthttpd)
There are no performance risks as from one visitor request to old location, redirect answer and than request to new location will come in turn and not simultaneously.
DNS records are not capable of HTTP redirection which is crucial for SEO. To make sure your redirect is 301 HTTP redirect you can use sniffer.
The answer is just make sure your redirect is 301 HTTP redirect so you get your SEO right. Other than that it's just a matter of taste / architecture / money rather than standards.
UPDATE
Read more:
wikipedia
Both Bing and Google recommend using a 301 redirect to change the URL of a page as it is shown in search engine results.
ehow.com
A 301 redirect is a search-engine friendly way to move a domain. The 301-redirected domain does not cause duplicate content in the search engines so that you do not harm your search engine rank. Using a new DNS setting is required to have a new domain name, but it does not redirect browsers or search engines. Both of these methods are used to move to a new domain.
webmasters.stackexchange.com
Duplicate content occurs when the same content is available on two different URLs. To prevent duplicate content on www vs no-www, use 301 redirects to redirect one to the other. To implement redirects, it is the webserver that needs to be configured properly. As long as DNS is pointing to the webserver (either CNAME or A record), then the webserver can be configured properly.
I was stuck with this problem some months back. I wanted to redirect a whole site into a new site's structure. The old site was .php which I know nothing about.
I figured I'd point the old website's DNS at my server and write some MVC code to catch every request, and then use a set of rules using the vb.net Like operator to compare the inbound Url with my ruleset.
It worked a treat. I redirect 300+ pages to my new site with about 10 rules. These include changes of folder structure, a forum (which was mainly junk but had a few good questions), and I implement a "catchall" rule which points to the new home page, in case I missed something.
It worked so well I've packaged it up as a commercial product and it publically available. It is free with link from the destination site (in your case just the single destination site).
https://301redirect.website/
There are a couple of demo videos on the homepage which will explain the setup in a few minutes.

301 Redirect without hosting

I have a client who is merging two sites into one. For the time being we are just installing a WP plugin to the site to manage the handful of 301 redirects they'd like handled, rather than writing to .htaccess manually.
But in a month or two they'd like to remove the site completely. Is there a way we can redirect traffic to the new combined site once they get rid of their hosting and we no longer have access to their .htaccess?
I have seen some brief mentions of setting the DNS to something but I don't totally understand and I'm not sure if this is the right thing to do. I have not asked the client if they are holding onto the domain name. In order to point the DNS to the new site, we'd need them to still own the old domain, correct? What would I assign the values to be?
You have to own the domain to do anything with it including updating DNS name. It wouldn't be smart to let it go.
If they don't have hosting on it anymore, then they will need to do domain forwarding with DNS. It can be done with 301 or 302 status codes. This link will show you how to do it on Godaddy. If you don't have Godaddy as your registrar, just look for the instructions for your domain registar.
https://www.godaddy.com/help/manually-forwarding-or-masking-your-domain-name-422

URL Canonocalization with w2 instead of www?

Recently while scrolling around the internet I've found a few websites that have w2 at the beginning of the URL instead of www. I'm not really sure of what the purpose of using this form of canonicalization may serve, other than just to be different. But after seeing that the Vatican's website also has it now, I'm starting to think it may actually have a functional purpose.
The Vatican's website has a lot of interesting redirects, but for me at least they all end up going back to w2.vatican.va as the base URL.
www.vatican.va redirects back there, google redirects there although it was indexed with the www.
So what is the purpose of using w2 instead of www?
The w2 is a subdomain, just as www is actually a subdomain. vatican.va is the top-level domain.
There are many uses for subdomains that usually come at the discretion of the developers, engineers, or administrators of a web site.
This is why sometimes you will see websites without the www (e.g. https://example.com). They have chosen to exclude the www subdomain. Most will pick one version to be their canonical and redirect the other to it.
In the example you provided, they chose to make their primary subdomain w2.vatican.va at some point and are redirecting (likely older) links from the www.vatican.va to the new one.
Additionally, the w2 domain may indicate that the web server is using IBM's CICS Transaction Server. The w2 may be it's default listener and the server administrators did not choose to change it.

What is the best way to move a large and complex site (which will need extensive testing) to a new server?

We need to move a large and complex site to a new server, and we need to ensure there is minimal downtime / disruption for our members.
This is what we have in mind:
Create a new domain (e.g. oursite.club) on the new server, for testing purposes. (We're planning on doing this because the temporary URL that works with some hosts / sites does not appear to work on ours)
Upload all existing code and import all databases to the new server.
Make any changes to allow for the new server path / domain name / different database names, where necessary.
Thoroughly test the .club site.
Add the current live domain (e.g. oursite.com) to the new server as an alias of the .club domain.
Once we're confident the new site works, change the DNS of the .com to point to the new server.
Also, add htaccess redirects on the old .com site to point to the same page on the .club domain, so that the site can still be accessed by those members for whom nameservers are not yet propagated.
After everything is working and all nameservers should have propagated, we want to make the .com the "real" domain and optionally retain the .club as an alias (i.e. swap the two domains on the new server).
This is what we have in mind:
Delete the add-on domain from the new server (i.e. the .club) and the alias domain (i.e. the .com) - but leave all the code / data where it is.
Re-add the .com, but point that at the server path where the .club code was uploaded.
Re-add the .club, but as an alias of the .com (or use URL forwarding at our domain registrar).
Make sure everything still works.
Update the htaccess redirects on the old server to send .com traffic to the .com domain on the new server, just in case there are any nameservers still pointing to the old server.
Since the nameservers for the two domains are already pointing to the new server, and that won't change, we thought this would offer the fastest way of swapping these two domains around.
We've done some testing with spare domains and a default WP blog, and this seems to work, but we wanted to call on your collective experience here to ask:
A. Will this work?
B. If not, what have we forgotten to take into account?
C. If so, good, but is there a better / easier way to accomplish this (especially the bit where we flip-flop the two domain names on the new server so that the current .com domain remains as the primary one to use)? For example, would it work if we add the .com to the new server (instead of creating a .club) and then edit our local hosts file during testing? Or can we use a VirtualHost directive to help with the domain swapping?
Although we've been building / running site for many years now, this is the first time we've had to move a membership site that is business-critical and where any excessive downtime / issues will cause us and/or our members real issues.
Many thanks!
I'm not sure if I'm missing something significant here (I don't entirely understand your need to flip flop the domains at the end), so I'll quite likely change this answer depending on comments etc (or delete it if I've completely missed a point!)
My approach to this would be
Set your DNS TTL for www.example.com to a very low number, 600 seconds perhaps. Don't plan the move until your current TTL expires (from the moment you make the change)
Create website on new server,configure the site under your example.club domain and example.com
Configure the hosts file on your testing machines with the IP Address of the server, and www.example.com This way your testing machines are going to actually test the full structure of example.com.
Test against example.club if you are concerned about broken links to the new domain, but since that is only temporary, it shouldn't really matter.
when it is tested and you are confident it is working, switch the DNS over.
Once you are comfortable that everything is working as expected reset your DNS TTL to a more sane figure.
As long as your database is in sync, there would be minimal (if any) downtime from this and at the end you can simply delete the example.club reference without any impact.
Depending on the value of the site, and the impact of potential downtime it might be worth putting a load balancer between both sites, and gradually increase the traffic that is sent to the new site so you can monitor progress. (you could use a load balancer from Azure which has no restrictions on being used against external sites)

Using DNS to Point a Domain to a Specific Page?

I know this question seems pretty straight-forward, but I'm having a hard time pulling up any answers on Google / Other Forums.
A client has a few domains parked on Network Solutions - not attached to any hosting account. I'm planning to point one of the recently purchased domains to a sub-directory of our main site (hosted elsewhere) - as part of a special promotion that's running.
However, Network Solutions now charges for Web Forwarding. In hopes of avoiding an additional charge I thought I'd use the DNS settings to point the IP to the site - but that just takes the user to the main website's home-page --- and not the specific sub-directory I need it to.
Since the domains are just parked - and not associated with a hosting account, I don't have access to a .htaccess file to deal with 301 forwarding or anything there.
Any ideas? Thanks in advance!
Just point the DNS to your server and set up vhosts for each of the new domains. Then, drop in a one-line JS or PHP index file (or mod_rewrite rule) to redirect to the desired page on your main site.

Resources