Credit Cards - Loans - Gourmet Chocolate Assortments - Buy PSP - Buy Anything On eBay

PDA

View Full Version : Best way to Redirect


rcochran
Nov 4th 2004, 1:12 pm
Can someone tell me the best way to redirect to a new page so as not to anger the search engine spiders?

ResaleBroker
Nov 4th 2004, 1:30 pm
What do you mean? Redirect from where?

Protoss
Nov 4th 2004, 1:50 pm
google on "301 redirect"

minstrel
Nov 4th 2004, 7:56 pm
Can someone tell me the best way to redirect to a new page so as not to anger the search engine spiders?
There are several ways, depending on what type of server you are on and what type of web page and whether you have the ability to add or edit an .htaccess file on your server.

I'm assuming you have just renamed or moved a single page, not your entire website?

Assuming further that you are still on the same server, the simplest way is probably to create a new page with the same file name as the old page like this:

<HTML>
<HEAD>
<META HTTP-EQUIV="REFRESH"
CONTENT="10; URL=http://www.yourdomain.com/newpage.html"><TITLE>This page has moved</TITLE>
</head>
<BODY>

<P>This Page Has Moved<BR>
Please update your bookmarks to
<A href="http://www.yourdomain.com/newpage.html">
http://www.yourdomain.com/newpage.html</A>
</p>
</body>
</html>
The part in red above redirects your visitors to the new site after 10 seconds. Don't set it to less than 10 or search engines may think you are trying to fool visitors by "stealth" redirecting.

Alternatively, if your host allows an .htaccess file, as Protoss implied you can use a 301 redirect:
Redirect 301 /oldpage.html http://www.yoursite.com/newpage.html or
Redirect permanent /oldpage.html http://www.yoursite.com/newpage.html
Or, if your page is PHP or ASP, you can add a script that will accomplish the same thing...

rcochran
Nov 12th 2004, 6:57 am
Thank you all for your replies. I do use asp pages and would be interested to know what script might be used to redirect an old page to a new page. Also will be looking into the 301 redirect. Thanks again.

minstrel
Nov 12th 2004, 7:06 am
ASP 301 redirect

<%
Response.Status = "301 Moved Permanently"
Response.addheader "Location", "http://www.yourdomain.com/newpage.asp"
Response.End
%>

J.D.
Nov 25th 2004, 10:06 pm
It is less work to configure IIS to redirect HTTP requests. For example, if you would like to redirect http://127.0.0.1/old-dir to http://127.0.0.1/new-dir, right-mouse click on old-dir in IIS administrative applet, click Properties, then on the Directory tab, select "A redirection to a URL". In the edit box below type /new-dir/ and check the checkbox "A permanent redirection...".

Make sure the path begins with a slash, as shown in the example above. IIS will append this new path to the server's host name to form the complete HTTP redirection header (eg. http://127.0.0.1/new-dir/).

J.D.