PDA

View Full Version : link my first page to another site?


fabian9931
02-03-2008, 02:42 AM
hello everyone... I have a site that i currently have running, let say that site is called "abc"... but i also have another site (xyz) which isnt up yet and will be soon... how do i set up dreamweaver so that when someone goes on abc it forwards them to my xyz site without any clicks... as soon as they put abc.com for example and they hit enter or go it brings them to my xyz site... i am new to dreamweaver and if this sounds like a newbie question i apologize..

fabian

cocoonfx
02-03-2008, 03:02 AM
You want a redirect. Some web hosting companies have this as a button on there control panel. Otherwise you would need to use PHP.

Here is a link for the script

http://php.about.com/od/learnphp/ht/phpredirection.htm

fabian9931
02-03-2008, 03:15 AM
hey thanks for the reply and so quick also.... but im very new to this.... i copied and pasted that in the code section and im getting no forwarding when i look in the preview in Internet explorer... i did change the url with my site... can someone just type it out as it would be written? thanks sorry guys

fabian

mangofreak
02-04-2008, 02:14 AM
Put the following script between the head tags of your html and replace the URL(http://www.yoursite.com/whateverpage.html) with the one you want to use:

<head>

---------------------------------------------------------
<title>your Page name</title>
<script language="javascript" type="text/javascript">
<!--
function redirect() { window.location.href = "http://www.yoursite.com/whateverpage.html";}

//-->
</script>
------------------------------------------------------------
</head>


Then this on your body tag:

<body onLoad="redirect()">

fabian9931
02-04-2008, 02:45 AM
ok. im sorry for this... but it's not clicking for me... sorry and please be patient with me... i am sure for all the professionals this probably sounds silly and i do apologize... but when i hit create new php and i start fresh this is what i have already...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>


now lets say i want to forward my site to www.printroom.com (http://www.printroom.com).... can you please help me now... thank you...

fabian

davidj
02-04-2008, 07:45 AM
i would use the following in your HEAD tags


<meta http-equiv="refresh" content="0;URL=http://www.newsite.htm" />


my favorate acronym.... KISS

d a v e
02-04-2008, 10:00 AM
i was just wondering when someone was going to mention that :)

domedia
02-04-2008, 01:21 PM
Because a zero meta redirect might not carry over any Google pagerank and other goodness. Worst case scenario they think you're screwing around and penalize your site. You might want to look into using a 301 permanent redirect through your .htaccess file.

fabian9931
02-04-2008, 06:45 PM
ok so i followed your reply and i have this now...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="refresh" content="0;URL=http://www.printroom.com.htm" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>

and when i go preview in internet explorer all i see is all the codes written out, it doesnt forward me to printroom.com...

davidj
02-04-2008, 06:46 PM
have you pasted it in design view???

tux
02-04-2008, 06:48 PM
Sounds like you might have typed/copied this code into design view.

It should be typed/copied into code view.

mangofreak
02-04-2008, 07:06 PM
This is almost ok. but you have to have it like this:
<meta http-equiv="refresh" content="0;URL=http://www.printroom.com" />

and not:
<meta http-equiv="refresh" content="0;URL=http://www.printroom.com.htm" />

fabian9931
02-04-2008, 09:46 PM
i pasted it in code view... and when i go preview it... it just gives me the text....

mangofreak
02-04-2008, 10:43 PM
Post the whole code of the page you have.

1. Go to Code view, select all
2. copy
3. paste so we can see what you are doing.

fabian9931
02-04-2008, 11:43 PM
ok i clicked on code view.... select all.... copy.... and pasted it here...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="refresh" content="0;URL=http://www.printroom.com" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>

fabian9931
02-05-2008, 05:08 AM
ok so the first couple of replies said to do this in php, which i did, but i now realize that if i did this in html it redirects fine.... would htlm be ok?

Cary
02-05-2008, 05:24 AM
It's recommended against because doing this with a meta tag can break the browser's back button, preventing people from going back to the page they were on when they clicked to go to your page.

mangofreak
02-05-2008, 02:41 PM
The main problem I find is that you are not clear as to what technology you are using. html, asp or php or jsp ??? If you were sure, then, the help would be more accurate. As a consideration to those trying to help, you should do your homework and be clear when requesting for help. All the redirecting answers I saw were doing pretty much the same, however, some may have some pros and cons as Domedia mentioned in one of his post. Now, it is up to you to decide which one fits your need. You can do more research using Google and checking for optional approaches.

Here is your first post:
------------------------------------------------------------------------
hello everyone... I have a site that i currently have running, let say that site is called "abc"... but i also have another site (xyz) which isnt up yet and will be soon... how do i set up dreamweaver so that when someone goes on abc it forwards them to my xyz site without any clicks... as soon as they put abc.com for example and they hit enter or go it brings them to my xyz site... i am new to dreamweaver and if this sounds like a newbie question i apologize..
------------------------------------------------------------------------