How To Redirect HTML Web Page Into another URL?

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/how-to-redirect-html-web-page-into-another-url/
PINTEREST
PINTEREST
INSTAGRAM

HTML is a language used to build web pages. Web pages have a dynamic nature where it can change during time. One of the most popular change case is redirecting given web page to another web page. This is simply called we page redirect. In this tutorial we will examine the redirect process in different ways, languages and technologies.

HTML Redirect

The most popular and basic for web page redirect is using HTML. HTML have two main parts named <head> and <body> . We can provide some special tags into <head> in order to redirect HTML page. We will use <meta> tag with detailed attributes. In this example we will redirect to https://www.poftut.com . We will use http-equiv attribute with refresh value.

JavaScript Redirect

Java script is client side technology which can make dynamic changes after or during HTML page load. JavaScript language provides window.location object which is used to get and set current page URL.

OR JavaScript provides different mechanisms to change or redirect HTML web page.

Apache Redirect

Apache is a popular web server. We can redirect a page by using Apache on server side. We can use Redirect or RedirectMatch directives to redirect web pages completely or specifically.

We can redirect pages starting with /blog

Or we can redirect specific web page like page.html in the following example.

LEARN MORE  Understanding and Configuring Apache Access Log

Nginx Redirect

Nginx is another popular web server used to serve web pages. It can redirect web pages using return directive. This can be also used to redirect http web pages to the https versions.

Lighttpd Redirect

Lighttpd is web server used to server light we sites. We can use  mode_redirect module and its url.redirect function to redirect HTML web pages. In this example we will redirect http://www.poftut.com into https://www.poftut.com .

PHP Redirect

PHP provides the HTML redirect features with header() function. Actually header() function will insert HTML meta tag into the the HTTP response. header() usage is very simple where we just provide the Location: with the URL we want to redirect.

Ruby on Rails Redirect

Ruby on Rails provides ApplicationController class which can be used inherit into our class. We can used index function and put redirect_to function for  redirection.

.Net Redirect

.Net provides languages like C# and Visual basic. We can use Reponse class and its functions Redirect() and attributes Status , AddHeader.

OR

LEARN MORE  Introduction to Javascript Programming Language

OR

Node.js Redirect

Node.js provides writeHead() function with http library. We can redirect into http with the following code.

Flask Redirect

Flask is a python framework which uses app.route() and provides redirect() .

Golang Redirect

Golang provides net/http library which provides http.HandleFunc() to handle HTTP response and using Redirect() function to write new redirect URL.

 

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/how-to-redirect-html-web-page-into-another-url/
PINTEREST
PINTEREST
INSTAGRAM