How to redirect a Web URL

There are different methods to redirect a Web URL or Page to a different URL or Page. Redirection cab be done using HTML , JavaScript,  Apache or PHP.

In this post we will look at all different ways.

HTML redirect

Using meta refresh tag of HTML.

 <meta http-equiv="refresh" content="0;URL=''" />    

PHP redirect

Using PHP header function. Its sends a 302 redirect. Its must be used at top of page before any HTML tag or PHP code.

 <?php header('Location:'); ?> 

JavaScript redirect

window.location object can be used to redirect to any URL ot page.

 <script> window.location.replace(""); </script>

jQuery redirect

 <script> $(location).attr('href', '') </script>

Apache .htaccess redirect

 Redirect permanent /

There are many ways to redirect in JavaScript and jQuery. There are most commonly used methods.

read more
adminHow to redirect a Web URL

How to Autoplay a YouTube video in Iframe embed

By Default a YouTube Iframe embed code don’t auto play a video  when embedded on a web page.

It can be auto played by simply adding this URL parameter in URL of video.


So, The iframe code for a YouTube video which auto play when embedded on a page is

<iframe width="640" height="360" src=";autoplay=1" frameborder="0" allowfullscreen></iframe>


read more
adminHow to Autoplay a YouTube video in Iframe embed