How to Redirect or Forward a Website (URL Redirection)
How to Redirect or Forward a Website (URL Redirection)
There are several methods available for redirecting a domain or URL to another address. Here are the most common techniques:
1. Using the URL Redirection Tool
In your hosting Control Panel, you can find the URL Redirection section under Advanced > URL Redirection. Select your redirection options, and click on the Help button for detailed assistance.
2. Framed Redirection
If you want to redirect visitors while keeping the URL unchanged in the address bar, framed redirection can be used:
<html>
<head>
<title>TITLE OF THE PAGE</title>
<frameset cols="100%">
<frame src="https://my-best-domain.net" />
</frameset>
</head>
<body>
</body>
</html>
Replace TITLE OF THE PAGE
and http://my-best-domain.net
as needed.
3. Using .htaccess and Redirect Directive
For SEO-friendly redirection, you can use a 301 redirect through an .htaccess
file:
Redirect 301 / http://my-best-domain.net/
This informs search engines that your URL has permanently changed. To redirect a single page:
Redirect 301 /oldpage.html http://my-best-domain.net/newpage.html
4. Redirecting with the META Tag Refresh
Add this in an HTML file to immediately redirect visitors:
<meta http-equiv="refresh" content="0;URL=http://my-best-domain.net">
5. Using PHP Header for Redirection
Create an index.php
file with the following code for a permanent redirection:
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.my-best-domain.net");
?>
6. Redirecting with JavaScript
Use JavaScript for a simple redirect:
<script type="text/javascript">
window.location = "http://www.my-best-domain.net";
</script>
Additional Redirect Configurations
- Redirect all www traffic to non-www:
- Redirect all non-www traffic to www:
- Redirect to HTTPS:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.my-best-domain.com [NC]
RewriteRule ^(.*)$ http://my-best-domain.com/$1 [L,R=301]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^my-best-domain.com [NC]
RewriteRule ^(.*)$ http://www.my-best-domain.com/$1 [L,R=301]
RewriteEngine On
RewriteCond %{SERVER_PORT} !443
RewriteRule ^(.*)$ https://www.my-best-domain.com/$1 [R=301,L]
Need Help?
If you need further assistance with URL redirection, feel free to contact our support team.
Contact SupportTags: .htaccess redirection, forward website, framed redirection, JavaScript redirection, meta refresh, PHP redirect, SEO redirect, URL redirection, website redirect