We can do the url or file redirection in website with Two ways:-
1) index.html
2) index.php

1) index.html:-
For doing redirection through index.html file we need to add the below given code into the index.html file:-
Note:- This code should be placed inbetween <head> and </head> which is before body tag.

Code:- <meta http-equiv="refresh" content="0;URL='http://redirect-to-this-url/'" />
Here:- 0 means without delay it shall redirect immediately.

2) index.php:-
For doing redirection through index.php file we need to add the below given code into the index.php file:-
Code:- <?php
/* Redirect browser */
header("Location: http://redirect-to-this/");
/* Make sure that code below does not get executed when we redirect. */
exit;

Here:- The location could be abc.com/his-required-folder/filename.php/filename.html etc.

Was this answer helpful? 0 Users Found This Useful (0 Votes)