Mobile app version of vmapp.org
Login or Join

Login to follow query

More posts by @Gretchen104

3 Comments

Sorted by latest first Latest Oldest Best

 

@Angela700

The easiest ways to do a redirect in order from the old-fashioned method to the best method is as follows:

Code snippet 1

saved as index.html in the document root of the old URL.

<html>
<head>
<title>Redirecting</title>
<meta http-equiv="refresh" content="1;URL=http://store.xyz.com">
</head>
<body>
<p>Loading new page</p>
</body>
</html>


It works but the experience is rather slow because the digit in the content value of the meta tag is the number of seconds before the refresh actually happens.

Code snippet 2

saved as index.html in the document root of the old URL.

<html>
<head>
<title>Redirecting</title>
</head>
<body>
<p>Loading new page</p>
<script type="text/javascript">
window.location.href="http://store.xyz.com";
</script>
</body>
</html>


This method is faster, but the user needs javascript enabled in their browser.

Code snippet 3

saved as index.php in the document root of the old URL.

<?php
header("HTTP/1.1 301 Moved Permanently",true);
header("Location: store.xyz.com ,true);
?><html>
<head>
<title>Redirecting</title>
</head>
<body>
<p>Loading new page</p>
</body>
</html>


In this last snippet, I did add extra HTML but most browsers would pick up the HTTP headers and automatically do the redirection quickly.

Pick any snippet and add a link pointing to the new URL just incase the automatic redirection does not work in any particular web browser. Some web browsers can be very buggy.

10% popularity Vote Up Vote Down


 

@Rivera981

For the sake of SEO, and maintaining your pages' rank, you may want to permanently redirect the old URLs to the new ones. Here's the Google documentation on redirects.

10% popularity Vote Up Vote Down


 

@Annie201

You most certainly do not have to buy store.xyz.com as a new domain name. store.xyz.com is a part of xyz.com

A domain name is made up of multiple parts
google.com google.com | | | --- domain name extension
| | --- domain name
| --- subdomain


mail.google.com

mail.google.com
| | | --- domain name extension
| | --- domain name
| --- subdomain


Your ownership of the domain name entitles you to unlimited subdomains, but your webhost may choose not to let you create them. (In fact, you already have one subdomain, xyz.com) Your web host / domain name registrar may also attempt to trick you into paying for subdomains.

The specifics of how to set up a subdomain vary depending on your hosting configuration.

For GoDaddy:



Next to the hosting account you want to use, click Manage.
In the Domains section, click Subdomains.
Complete the following fields, and then click Create:

Subdomain — Enter the subdomain you want to use for one of your hosted domain names.
Select the domain name for which you want to create the subdomain.
Document Root — Enter the directory you want to use as the root directory for the subdomain's website, or use cPanel's default.




Quoting Godaddy's page on Managing Your Hosting Account Subdomains

(For other people who see this answer other than the OP and are not on GoDaddy): To redirect /store to this subdomain , see the other answers.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme