cancel
Showing results for 
Search instead for 
Did you mean: 

Web redirect

zpeterk
Grafter
Posts: 377
Registered: 14-04-2007

Web redirect

I have a web site with two domain names.
How do you setup the old domain name to show as the new one when people access the old one?
14 REPLIES
N/A

Web redirect

If people are only ever entering your site by the home page then the best thing is to put a line like this into your index.html headers:
<META HTTP-EQUIV="REFRESH" CONTENT="1;URL=www.new-web-site.com/index.html">
N/A

Web redirect

you could also use a javascript approach

<script language="Javascript">
top.location='http://www.new-web-site.com/index.html';
</script>
zpeterk
Grafter
Posts: 377
Registered: 14-04-2007

Web redirect

I put the
Code:
<META HTTP-EQUIV="REFRESH" CONTENT="1;URL=www.new-web-site.com/index.html">

in the page and now after the page has loaded it goes blank
with http:/www.new-web-site.com/index.html/www.new-web-site.com/index.html in the address bar
N/A

Web redirect

Quote

<META HTTP-EQUIV="REFRESH" CONTENT="1;URL=www.new-web-site.com/index.html">


The www.new-web-site.com bit is supposed to be the name of the site you want to appear. The new-web bot above is an example.
So if the other domain you want to appear is PeterZK.co.uk, then the URL bit above would be

URL=www.peterzk.co.uk/index.html
zpeterk
Grafter
Posts: 377
Registered: 14-04-2007

Web redirect

I did transpose it to the name
N/A

Web redirect

Whoops, just tested it and it doesn't work correctly. Try the java approach as mentioned above.
zpeterk
Grafter
Posts: 377
Registered: 14-04-2007

Web redirect

The file is called index.html

It is hosted with +net so the default is index.html

or does it need the /htdocs/index.html
N/A

Web redirect

It doesn't need the /htdocs bit as that is default for your webspace.
I have tried it and it doesn't work. I havn't had time to check out what the error is.
It loads the original then tries a reload resulting in page not found.
If I get time I'll investigate.
zpeterk
Grafter
Posts: 377
Registered: 14-04-2007

Web redirect

Do you know if the java one works?
N/A

Web redirect

The reason this isn't working is because you didn't attach http:// to the beginning of the URL. Therefore it looks for a directory called "www.new-web-site.com/index.html" on your existing site.

It should be something like:
<META HTTP-EQUIV="REFRESH" CONTENT="1;URL=http://www.new-web-site.com/index.html">


Change URL= to the site you want to redirect to, and CONTENT= to however many seconds you want it to wait before redirecting a user.
N/A

Web redirect

Bah, silly little mistake I overlooked - missing the http.
The pages for username.plus.com sites are still being cached as well, so a ctrl F5 is required to update.
Check if you are viewing the latest uploaded version of the file by viewing the source.
zpeterk
Grafter
Posts: 377
Registered: 14-04-2007

Web redirect

The redirect works but the page loads then keeps refreshing every time it completes
michaelscott
Grafter
Posts: 594
Registered: 09-08-2007

Web redirect

I'm making the assumption that the two domains point to the same place?

If that's the case then it will keep redirecting and you'll need JavaScript to determine which URL the visitor is at and whether or not to redirect them. I don't know JS so maybe somebody else could help out?

Baiscally,

IF(url = oldone) {
print redirect thing
}
N/A

Web redirect

This is because you are redirecting to the same page, so it is in an endless loop. We may have misunderstood what you wanted to do.

A messy way around this is to create a copy of the index.html, remove the redirect part and rename it something like mydomain.html.
create a blank index.html with only the redirect in it. Change the figure 1 to 0 and the redirect to .co.uk/mydomain.html
Now, when someone accesses your site by either route (username.plus or .co.uk) the index.html will redirect them to the mydomain.co.uk version and subsequent pages will be .co.uk linked.

There are other ways of redirecting that are less messy, such as using .htaccess and Frame src> take you pick.
For the htaccess method, look at the htaccess tutorial in this forum.