Forum Moderators: phranque

Message Too Old, No Replies

Safest re-direct for several pages in a site

         

kapow

1:23 pm on Feb 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If I have a site about widgets and for some time there has been 10 pages on that site about blue-widgets, - what is the best form of redirect to use when I make a new site dedicated to blue-widgets? e.g. 10 second refresh and those pages?

Is there some kind of official redirect code that can be used for just a few files within a site (like redirect 301)?

soapystar

3:46 pm on Feb 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



like 301?...surely its a 301 for each url that u want to redirect!

HitProf

8:38 pm on Feb 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For bots 301 may be best but its better to educate your regular visitors to update their bookmarks. In the mean time you can build up links and rankings for the new site. Switch to 301 when you don't get visitors on old pages anymore.

kapow

10:21 am on Feb 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What is the syntax for 301 for specific pages (instead of for a whole site)?

e.g. for a whole site I use:
redirect 301 / [domain.com...]

Does anyone think a 10 second refresh on those pages is a better solution?

hakre

10:49 am on Feb 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi kapow,

you can't do a redirect for a whole site. your example from above indeed does for your main page only (even not for /index.html, just the domain-page).

the syntax for a redirect depends on what you use. in plain text http protocol, this would be:

- pass 301 as status code
- add a header called 'Location:' with the new permanent uri.

if you use a script language, for example php, this would be:

header('Location: [i]new permanent uri[/i]');

php will automatically add the 301 status.

you can use severall other ways, like mod_rewrite in .htaccess files for example using rewrite_rule with the [R] flag.

kapow

12:00 pm on Feb 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have placed
redirect 301 / [domain.com...]
into a .htaccess file on several sites and it works fine.

DaveAtIFG

4:12 pm on Feb 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



RedirectMatch will allow you to redirect selected pages. Check the mod_alias docs here [httpd.apache.org].

kapow

5:46 pm on Feb 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks DaveAtIFG

...permanent: Returns a permanent redirect status (301) indicating that the resource has moved permanently.

Example: Redirect permanent /one [example.com...]

But I still can't see how I say

[example.com...] is now at [new.com...]
[example.com...] is now at [new.com...]

when the remaining pages stay the same. I need some syntax that lets me say old address = new address (for a selection of files - if you see what I mean.

This is feeling a bit complicated, perhaps I'll just go for the 10 second refresh.

DaveAtIFG

8:25 pm on Feb 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



My apologies kapow, I assumed you were aware of this post [webmasterworld.com]. It should help you understand your options a little better.

Note: "Redirect" and "RedirectMatch" are different mod_alias directives with differing capabilities. The link I posted above is to RedirectMatch. Your subsequent example still refers to Redirect.

Also, a 10 second refresh returns a 200 status code to visitors so SEs/spiders have no reason to update your listings.