Sometimes you may need to redirect your site users from the front page or from a subfolder to a specific file or even to another URL.
Redirect to another page
This is achieved by the following steps:
1. Open notepad and put the following code replacing http://www.new-url.com with the point to which you want the user to be redirected:
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.new-url.com" );
?>
2. Save the file as index.php
3. FTP the file to httpdocs or the folder you want the user to be redirected from
Redirect to another path of the same page
If, for example, we have the site my-website.com and we want the users, when the site opens, to be redirected to the page my-website.com/eshop/, follow these steps:
1. Open notepad and add the following code replacing http://www.new-url.com/eshop/ with the point to which you want the user to be redirected:
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.my-website.com/eshop/" );
?>
2. Save the file as index.php
3. FTP the file to httpdocs or the folder you want the user to be redirected from.
Contact our experts, they will be happy to help!
Contact us