how to code direct 1 link to another link of website?

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

newbiecom

Thread Starter
Joined
Oct 25, 2007
Messages
22
hi everyone

I need your help. I have 2 websites, and I would like to link from website 1 to website 2. for example, when I search engine for my website 1, and it appear on search engine site. Then I click on website 1 link, it will transfer automaticaly to website 2. Please help me anyone if you know tell me how to do it. or you have know how to code it..please show me how.
Thank you very much.

Phil
 
Joined
Oct 25, 2007
Messages
551
To achieve yourr desired effect you will have to build a redirect page. I'm a bit new to doing these, so I hope it works.

First, go into notepad and make a file called ".htaccess" (make sure it is called exactly that and if notepad adds ".txt" to the end, go into My Computer and change the name back.)

Open the file for editing. Inside, put this:

Code:
redirect 301 /old/old.htm http://www.new.com/new.htm
You must put that exact code into the file, apart from changing "old" and "new" to your old site and the site you're redirecting to. Make sure the files "old.htm" and "new.htm" have the right names and file extensions.

When you've done that, upload the file to the same level as the page you are redirecting from on your old server. The "redirect 301" tells the browser that the site has been permanently moved.

I hope it works.:p
 

newbiecom

Thread Starter
Joined
Oct 25, 2007
Messages
22
thank you so much TheRobatron. I will try see it work o not and let you know later.
thanks again.

Phil
 
Joined
Oct 25, 2007
Messages
551
I've found the problem (hopefully). It was due to my explanation. Put the file into the root (top) folder on your server. Then put in the code you did before, but slightly differently:

Code:
redirect 301 /[B]filepath[/B]/index.html http://www.way-o-breath.com/index.html
The filepath should be substituted for the filepath that you have to take to get from the root of the server to index.html.

Hope that works.

Rob
 

newbiecom

Thread Starter
Joined
Oct 25, 2007
Messages
22
I don't really sure you said "the filepath should be substituted for the filepath that you have to take to get from the root of the server to index.html" can you tell me more clearly and simply to understand or can you give some examples. Please. Thank you very much Rob

Phil
 
Joined
Oct 5, 2007
Messages
32
TheRobatron said:
I've found the problem (hopefully). It was due to my explanation. Put the file into the root (top) folder on your server. Then put in the code you did before, but slightly differently:

Code:
redirect 301 /[B]filepath[/B]/index.html http://www.way-o-breath.com/index.html
The filepath should be substituted for the filepath that you have to take to get from the root of the server to index.html.

Hope that works.

Rob
Does it matter what your htaccess permission is set on?

I can't seem to get this working correctly no matter which file path I use.

Thank you
 

newbiecom

Thread Starter
Joined
Oct 25, 2007
Messages
22
I tried it..but not working. Do you have any idea differently KimbH?
Thank you for reply.
 

newbiecom

Thread Starter
Joined
Oct 25, 2007
Messages
22
thank you Rob. your code is working now..
"redirect 301 index.html http://www.way-o-breath.com/index.html". but it take a bit longer time to redirect (20 seconds). you have any idea to redirect faster?
thank again so much

phil
 
Joined
Oct 5, 2007
Messages
32
newbiecom said:
thank you Rob. your code is working now..
"redirect 301 index.html http://www.way-o-breath.com/index.html". but it take a bit longer time to redirect (20 seconds). you have any idea to redirect faster?
thank again so much

phil

I used the htaccess with redirect 301 /old/old.htm http://www.new.com/new.htm however it would not work in the mail root. I figured out the problem was I was trying to redirect a sub-domain so I had to put that in redirect 301 in the sub-domains' htaccess.

Hope that helps
 
Joined
Oct 25, 2007
Messages
551
Here's an alternative to using the 301 redirect:

Put this code in "index.html" of the old site:
Code:
<html>
<head>
<script type="text/javascript">
<!--
function delayer(){
    window.location = "http://www.newsite.com/newpage.htm"
//-->
</script>
</head>
<body onLoad="setTimeout('delayer()', 5000)">   [I]Change the 5000 to 0 for an immediate redirect[/I]
<h2 >Prepare to be redirected!</h2>
<p>This page is a time delay redirect, please update your bookmarks to our new 
location!</p>

</body>
</html>
FYI I didn't write that - I found it on the net :p (I'm not that good at javascript!)
 

newbiecom

Thread Starter
Joined
Oct 25, 2007
Messages
22
thank you very much Rob, and everyone. My website redirected now. It worked. Thank you.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top