Everyone need to redirect from one directory to another in their website ,like in my website from > liveurlifehere.com/blog to blog.liveurlifehere.com. Here is many way to redirect from one page to another page. or from one directory to another. Today, i write these methods for redirecting.
Five ways for redirection
- By .httaccess
- By php
- By html
- By Meta tag
- By javascripts
These methods we can use for redirection . Basically by my experience better method is no.1 but this is difficult for new guys. So easy method is by php (no.2), In this only one line program is written and page/directory is redirect. Same by html & javascript, you just need to write a script i.e
- Redirect by HTML and javascript
<script>
top.location(‘YOUR_URL’);
</script>
- Redirect By meta tag
- Redirect By PHP(for more click this link)
For redirect by php page , you write this code:
<?php
header(“Location:http://www.liveurlifehere.com”);
?>