http

What is MIME type?

MIME stands for “Multipurpose Internet Mail Extensions“. It’s a way of identifying files on the Internet according to their nature and format. For example, using the “Content-type” header value defined in a HTTP response, the browser can open the file with the proper extension/plugin.

What does a MIME type look like?

A MIME type is a string identifier composed of two parts: a “type” and a “subtype”. The “type” refers to a logical grouping of many MIME types that are closely related to each other; it’s no more than a high level category. “subtypes” are specific to one file type within the “type”.

For example, the MIME value “application/xml” is used for XML documents and specifies that the “xml” subtype belongs in the “application” type.

Why are some MIME subtypes prefixed with “x-“?

The “x-” prefix of a MIME subtype simply means that it’s non-standard, i.e. not registered with the “Internet Assigned Numbers Authority” (IANA).

URL redirection

URL page redirection is an automatic URL change operation from one URL to another URL.

This redirection is done for the following reasons:

Redirect from old obsolete URL to a new updated URL.

Redirect from old obsolete domain to a new domain.

Redirect from non www domain name to a www domain name.

Redirect from short URL name to a long URL name – URL shortening service.

URL shortening service will allow the user to insert a short URL and be redirected the the long URL that has the real page contents.

The user may reach the old URL from an old external links or a bookmark by the site’s webmaster who adds a script.

Server side redirect

Server side redirection is done in the server, by configuring the Apache / IIS server software or by using PHP / ASP / ASP.NET script.
This is the preferred way to redirect URLs, since you can return HTTP 301 Moved Permanently status code.
Search engines use the 301 status to transfer the page rank from the old URL to the new URL.

Client side redirect

Client side redirection is done in the web browser of the user, by using HTML meta refresh tag or by Javascript code.
Client redirect is less preferred, since it does not return HTTP 301 status code.

Where to put redirect code

Domain
name

Hosting
server

Redirect code
placement

not changed

not changed

old page on same server

not changed

changed

old page on new server

changed

not changed

old page on same server

changed

changed

old page on old server

* Only with .htaccess redirect: add redirect code to httpd.conf
file or to .htaccess file.

HTTP status codes

Status code

Status code name

Description

200

OK

successful HTTP request

300

Multiple Choices

301

Moved Permanently

permanent URL redirection

302

Found

temporary URL redirection

303

See Other

304

Not Modified

305

Use Proxy

307

Temporary Redirect

404

Not Found

URL not found

HTTP 301 redirect

The 301 redirect is the preferred way to redirect URLs, since it informs search engines that the URL has moved for good, and search engines should put the new URL page in the search results instead of the old URL page and transfer the new URL page, the page rank of the old URL page.
The 301 redirect can be done across domains or on the same domain.
Google recommends to use 301 redirect.

Redirect options

Redirect script

Redirect side

Old page file type

Redirect URL or domain

Old URL server type

301 redirect support

PHP

Server-side

.php

URL

Apache / Linux

yes

ASP

Server-side

.asp

URL

IIS / Windows

yes

ASP.NET

Server-side

.aspx

URL

IIS / Windows

yes

.htaccess

Server-side

all

URL / Domain

Apache / Linux

yes

IIS

Server-side

all

URL / Domain

IIS / Windows

yes

HTML canonical link tag

Client-side

.html

URL

all

no

HTML meta refresh

Client-side

.html

URL

all

no

HTML frame

Client-side

.html

URL

all

no

Javascript

Client-side

.html

URL

all

no

jQuery

Client-side

.html

URL

all

no

redirect script – the scripting language that is used for the redirection.

redirect side – where the redirection takes place – server-side or client-side.

old page file type – the type of the old URL page that can can contain the scripting language of the redirect code.

redirect URL or domain – does support URL redirection of a single web page or domain redirection of a whole website.

typical old URL server type – the typical software and operating system of the server.

HTML meta refresh redirect

HTML meta refresh tag redirection does not return 301 permanent redirect status code, but considered by Google as a 301 redirect.
Replace old page with redirection code with the URL of the page you want to redirect to.

HTML canonical link tag redirect

The canonical link does not redirect to the preffred URL, but it can be an alternative to URL redirection for websites that most of the traffic arrives from search engines.
HTML canonical link tag can be used when there are several pages with similar content and you want to tell the search engines which page you preffer to use in the search results.
Canonical link tag can link to the same domain and also cross-domain.
Add the canonical link tag to the old page to link to the new page.
Add the canonical link tag to the pages that you preffer not to get search engines traffic to link to the preffered page.

The canonical link tag should be added in the <head> section.

old-page.html:

<link rel="canonical" href="http://www.mydomain.com/new-page.html">

HTML frame redirect

In frame redirection the new-page.html file is viewed by an html frame.

This is not a real URL redirection.

Frame redirection is not search engines friendly and is not recommended.