There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen boot bsod computer connection crash css dell display driver drivers email error excel explorer firefox firefox 3 game hard drive internet internet explorer itunes laptop lcd linux malware network networking nvidia outlook outlook 2003 outlook express partition printer problem ram router slow sound sprtcmd.exe trojan usb video virus vista windows windows xp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
how to code direct 1 link to another link of website?


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
newbiecom's Avatar
Junior Member with 22 posts.
 
Join Date: Oct 2007
Experience: Intermediate
25-Oct-2007, 10:09 PM #1
Question how to code direct 1 link to another link of website?
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
TheRobatron's Avatar
Computer Specs
Senior Member with 470 posts.
 
Join Date: Oct 2007
Location: England
Experience: Intermediate
26-Oct-2007, 04:33 AM #2
Building a Redirect Page
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.
newbiecom's Avatar
Junior Member with 22 posts.
 
Join Date: Oct 2007
Experience: Intermediate
26-Oct-2007, 05:23 PM #3
thank you so much TheRobatron. I will try see it work o not and let you know later.
thanks again.

Phil
newbiecom's Avatar
Junior Member with 22 posts.
 
Join Date: Oct 2007
Experience: Intermediate
28-Oct-2007, 12:27 AM #4
Exclamation redirect link is not work. everyone has any idea? help
redirect 301 /www/index.html http://www.way-o-breath.com/index.html

this is a code I just set inside the file of .htaccess , but the redirect site is not work. do you have any idea, please help me. Thank you very much.

Phil
TheRobatron's Avatar
Computer Specs
Senior Member with 470 posts.
 
Join Date: Oct 2007
Location: England
Experience: Intermediate
28-Oct-2007, 09:49 AM #5
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 /filepath/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's Avatar
Junior Member with 22 posts.
 
Join Date: Oct 2007
Experience: Intermediate
28-Oct-2007, 10:10 PM #6
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
KimbH's Avatar
Member with 32 posts.
 
Join Date: Oct 2007
29-Oct-2007, 05:35 AM #7
Quote:
Originally Posted by TheRobatron
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 /filepath/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's Avatar
Junior Member with 22 posts.
 
Join Date: Oct 2007
Experience: Intermediate
29-Oct-2007, 09:12 PM #8
I tried it..but not working. Do you have any idea differently KimbH?
Thank you for reply.
newbiecom's Avatar
Junior Member with 22 posts.
 
Join Date: Oct 2007
Experience: Intermediate
30-Oct-2007, 05:28 PM #9
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
KimbH's Avatar
Member with 32 posts.
 
Join Date: Oct 2007
31-Oct-2007, 01:05 PM #10
Quote:
Originally Posted by newbiecom
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
TheRobatron's Avatar
Computer Specs
Senior Member with 470 posts.
 
Join Date: Oct 2007
Location: England
Experience: Intermediate
31-Oct-2007, 05:16 PM #11
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)">   Change the 5000 to 0 for an immediate redirect
<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 (I'm not that good at javascript!)
newbiecom's Avatar
Junior Member with 22 posts.
 
Join Date: Oct 2007
Experience: Intermediate
01-Nov-2007, 08:40 PM #12
thank you very much Rob, and everyone. My website redirected now. It worked. Thank you.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 07:46 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.