0

I want to redirect my old domain url to a new domain url

For example : www.abc.com (old url ) to www.examole.com (new url)

So i want to redirect my old url to new URL

Note: I don't have cpanel i have hosted my site in github and my domain is from freedom (a free domain)

ABBAS A M
  • 26
  • 10

3 Answers3

0

There are a couple of ways to redirect to another webpage with JavaScript. The most popular ones are location.href and location.replace

window.location.href = "http://www.examole.com";

OR

window.location.replace("http://www.examole.com");

Simply use a meta http-equiv tag to "refresh" the page to a new url as follows:

<meta http-equiv="refresh" content="0; url=http://www.examole.com">

The content sets how long to wait until to redirect the user, and the url sets where to redirect the user.

Tanmay Patel
  • 1,770
  • 21
  • 28
0

There a lot of methods to get this done, so, If I asume that you dont have access to host panel to make a redirect in cpanel or any other host manager, you can do this:

Create a new file, or replace index.php, index.htm or index.html code for this one

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv=Refresh content="0; URL=http://your-new.site"> 
<title>Your site</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <meta name="robots" content="index, follow" />
  <meta name="keywords" content="" />
  <meta name="description" content="" />
  <title>Redirecting</title>
</head>

<body>
 Redirecting to the new site...
</body>
</html>
0

Repost from here: Redirect from an HTML page

but,

<meta http-equiv="refresh" content="0; url=http://example.com/" />
Daniel
  • 61
  • 5