difference between http and www - html

pardon me for asking a very basic doubt.
I have hosted a page in the site collinfo.annauniv.edu
The page opens fine when i enter the address as http://collinfo.annauniv.edu
But when i gave www.collinfo.annauniv.edu my browser shows 404 error.
What is the difference that http causes here in place of www.

The www. before your domain is actually a subdomain. It's essentially the same thing as help.microsoft.com or orders.amazon.com.
With that in mind, there are a few things that could be happening:
1) Your DNS records do not include the appropriate A Record for the www subdomain.
In this case, you'll need to setup an A record that points to your web site's IP address. If you don't know how to do this, your web host should be able to help.
2) Your server is not configured to handle the www subdomain.
If you're using the apache web server, it needs to be configured to show your web site when the user enters www before your domain. Again, your web host can set this up for you.
It all comes down to a misconfiguration issue. If you don't have experience administering web servers, you may want to give your web host a holler.

www comes from the (rather) old time where a domain had several sub-features, of which the web was not always the main service. For instance
www.domain.tld for web
mail.domain.tld for mail
ftp.domain.tld for ftp
domain.tld for web
but this is a convention - any subdomain may point to anything actually.
This is more a question of DNS declaration and/or web-server configuration ; in this case it is probably that the web-server configuration does not trigger the same pages for www.domain and domain (since you get a 404).
The author / administrator of collinfo.annauniv.edu either forgot to create a DNS entry for www.collinfo.annauniv.edu or did not create a virtual domain (web-server side) for it that would point to the same pages as collinfo.annauniv.edu.

HTTP is a protocol.
http://collinfo.annauniv.edu
Is the address of a resource which can be retrieved using HTTP.
annauniv.edu is the domain in your case.
collinfo is the subdomain.
www.collinfo is also considered as a subdomain but it does not exist. That's why you get HTTP 404 not found.
Subdomain can be anything, www is usually used as it usually mean World Wide Web.

WWW is a subdomain
HTTP is a protocol (language)
Whether you specify HTTP in the browser or not, the browser will always assume the request is being of "http" type and will ussually add http:// for you.
WWW however is just an alternative subdivision of the domain name, the same as in:
www.domain.com
site.domain.com
sub1.domain.com
sub2.domain.com
.....
etc.domain.com
In most cases the WWW subdomain will point to the same "page" as the main domain, which is usually called the "index" page, such as index.html, or index.php and in most cases the index page is hidden in the browser's address bar, unless you specifically type it in, such as http://www.yahoo.com/index.html, but you have to understand that if you have a full control of your webserver you can modify these, so WWW doesn't point to the same page or you can call you main page "home.html" instead of "index.html" and instruct your webserver to "point" your browswer to that page by default.
But things like HTTP are not easily changed, since HTTP is the main language of the web and most browswers use that as the primary means to access the webservers.
Peace!

Related

How http and https relate to sitemap and site sources?

I am new in web development / SEO and stucked so hard on next moment:
We got sitemap file for helping SE robots index our pages correctly.
Sitemap could contain only URLs from current sitemap directory. For example: http://www.example.com/sitemap.xml can contain only links, whose exist in same catalog. But how data transfer protocols (http/https) relate to my finite directory, if it is just a way for transfer data? I have not two different folders with sources on my web server for http and https, lol. And indexing should not changing with protocol changes in URL. Same question i got for www subdomen. I know what a problem in my missunderstanding in web basics xD
Clients (such as search engine indexing bots and browsers) make HTTP requests to servers, which provide a response.
A URL is how a specific resource is located. It will specify the scheme/protocol, hostname, and path (and optionally a few other things).
A URL might specify HTTP or HTTPS (the latter adding an encryption layer).
The hostname portion of a URL might include www in the name or it might not.
When the server receives the request it will run some code to determine how to respond to it. A common and simple approach for that code is to match the path portion of the URL to part of the directory structure of the file system of the computer running the HTTP server software. It may, or may not, use different directories as the root for this depending on the hostname and protocol.
This means that you might have an HTTP server providing both HTTP and HTTPS and mapping www.example.com and example.com onto the same directory resulting in (at least) four different URLs all mapping onto any given file.
Best practise is to pick one of those as the canonical URL (with preference given to HTTPS and various arguments for with or without the www (which mostly revolve around convenience and how cookies for the primary hostname will be handled on other subdomains).
When writing absolute URLs (e.g. in sitemaps, emails and business cards), use the canonical URL.
It is generally recommended that the server be configured to issue 301 Redirects from the non-canonical URLs to the canonical equivalent.

Which robots.txt for forwarded subdomain?

In theory I have two subdomains set up in my hosting:
subdomain1.mydomain.com
subdomain2.mydomain.com
subdomain2 has a CNAME record pointing to an external service.
mydomain.com has a robots.txt that allows indexing everything.
subdomain2.mydomain.com has a robots.txt that allows indexing nothing due to the CNAME record.
If I set up a forward from subdomain1.mydomain.com to subdomain2.mydomain.com, which robots.txt would be used if accessing a link to subdomain1.mydomain.com? Does the domain forward work in the same way as a CNAME record when it comes to robots.txt?
This depends on your server setup.
Take the following config, for example:
server {
server_name subdomainA.example.com;
listen 80;
return 302 http://subdomainB.example.com$request_uri;
}
In this case, we're redirecting everything from subdomainA.example.com to subdomainB.example.com. This will include your robots.txt file.
However, if your configuration is set up to only redirect certain parts, your robots.txt file will only be redirected if it's on your list. This would be the case if you were redirecting only, say, /someFolder.
Note that if you don't return a 302 but just use a different root (e.g. subdomainA and subdomainB are different subdomains but serve the same content), your robots.txt content will be determined by the root directory.
So, therefore, if I'm understanding your config correctly, subdomain1 will use the the robots.txt from subdomain2.
The challenge you're running into is you're looking at things from the standpoint of whatever software you're trying to configure, but search engines and other robots only see the document they load from a URL (just like any other user with a web browser would). That is, search engines will try to load http://subdomain1.mydomain.com/robots.txt and http://subdomain2.mydomain.com/robots.txt, and it's up to you (through configuring whatever software your server is running) to ensure that those are in fact serving what you want.
A CNAME is just a way to add a redirection when loading what IP a browser should look at to resolve a domain name. A robot will use it when resolving the name to find out the "real" IP to connect to, but it doesn't have any further bearing on what the GET /robots.txt request does once it connects to the server.
In terms of "forwarding", that term can mean different things, so you'd need to know what a browser or robot would receive when it requested the page. If it's doing a 301 or 302 redirection to send the client to another URL, you'll probably get different results from different search engines on how they may honor that, particularly if it's being redirected to an entirely different domain. I probably would try to avoid it, just because a lot of robots are poorly written. Some search engines have tools to help you determine how their crawlers are reading your robots.txt URLs, such as Google's tool.

Custom Jekyll post types to a subdomain

Without messing about with .htaccess or another Jekyll install, how would one go about having a page or custom post type route to a subdomain? For example, _portfolio would go to http://portfolio.lendmaico.com/ rather than http://lendamico.com/portfolio?
This would be handled at the DNS and web server level.
Update your DNS to make sure that http://portfolio.lendmaico.com/ resolves to your server (it may already depending on how it's setup).
In your web server config, point incoming traffic for 'portfolio.lendmaico.com' to the physical directory path. That is, if your server config is setup to point the main lendamico.com domain to .../some/path/lendamico.com, you would add a config to point portfolio.lendmaico.com to .../some/path/lendamico.com/portfolio.
Note that unless you specifically add an htaccess type rule to prevent http://lendamico.com/portfolio from showing, you would see the same thing there as http://portfolio.lendmaico.com/.

How is "Is offline for maintenance" page implemented?

Occasionally when I try to open a site I will see a page saying smth like "This site is offline for maintenance" and then some comments follow on how long it would presumably take. Stack Overflow does that too.
How does it work? I mean if the site is shut down who replies to my HTTP request and serves this page?
There is a trick in asp.net where you place a file called
App_Offline.htm
All requests will go to this, until the page is deleted.
For other environments you can often just change where the server points, or another such plan.
-- Edit
A server-agnostic approach is achieved through something like load-balancing.
Under the hood you can send the requests to a given internal server. You may then decide to point all requests to your server 'a', which you configure to show the 'downtime' page. Then, you make changes to server 'b', confirm it as successful, and point all requests to 'b'. Then you update 'a', and let requests go to both.
In ASP.NET (and ASP.NET MVC as Stackoverflow uses) this is provided by the app_offline.htm feature. This works simply by forwarding all ASP.NET requests to the app_offline.htm file.
Incidentally the copy Web Site tool in ASP.NET performs the process of placing this file in the root of the web app, copyies the Web site files and then deletes this file.
Strategies for other technologies are discussed here.
In apache you may use a .htacces file with this content.
order deny,allow
allow from 192.168.1.151
deny from all
ErrorDocument 403 404.html
ErrorDocument 404 404.html
ErrorDocument 500 404.html
This will deny access to everyone except one IP and serve a static 404.html file.
This works in the case you only have one server without load-balancing and other stuff. Should work for load-balancing too though.
The apache reverse proxy server can be configured to send that response - if it is being used as part of that architecture.

Subdomains do not work without the leading www

What is the difference between the following URLs?
http://www.forums.example.com and
http://forums.example.com ?
Actually I've created a new subdomain in my website and it's working fine when I try to access without www (i.e http://forums.example.com) But when I try to give URL like http://www.forums.example.com it is showing "Page not found".
Why is this and how can I fix the issue?
If I am not mistaken, www. is also considerd a Subdomain, hence when you setup hosting on a provider (i.e Slicehost) they tell you to put www in the subdomain list (again if I am not mistaken). If you really want www.fourms.duckyetc you can set up a script to do some matching, i.e
if url contains www.fourms.ducketc then go to here else go somewhereelse
You have to create a cname for www.forums.duckyvideos.com and also configure your webserver to respond to that cname. There is nothing automatic about www prefixes on the web. It's just a convention that websites are accessible with or without the www. Everyone hosting a website has to explicitly set up a second cname for the www prefixed version of every site they put up.