Forum Moderators: phranque

Message Too Old, No Replies

giving .doc files 301 redirect

redirect code

         

benevolent001

5:19 pm on Dec 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi i have about 10 ms word files in my website that ranks well on certain keywords...but now i want to replace those word files with actual html pages...but wanted to know the reditect code for this...i want to tell SE that this page has been moved to this location and....

thanks

kevinpate

5:39 pm on Dec 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The following always works for me (subbing in actual file and domain name of course). In my .htaccess file, on a single line:

Redirect permanent /folder/filename.doc htt*://www.domain.tld/folder/newfilename.html

(note: *=p)

benevolent001

5:43 pm on Dec 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks will this work for google too?
I mean will google read htaccess file?

jdMorgan

6:50 pm on Dec 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> Thanks will this work for google too?

It will work for any user-agent.

> I mean will google read htaccess file?

No, Google does not read htaccess files. htaccess files are processed only by the server itself. User agents requesting the old URL will get an HTTP 301-Moved Permanently response from the server and follow the new URL included in that 301 response to locate the new page.

Jim