iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Search Engine Optimization Forum SEO is much easier with help from peers and experts! The WebProWorld SEO forum is for the discussion and exploration of various search engine optimization topics. Any non (engine) specific SEO or SEM topics should go here.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-26-2007, 11:37 PM
WebProWorld Member
 
Join Date: Aug 2003
Location: Connecticut, USA
Posts: 68
pdrew RepRank 0
Default 301 redirect of .doc files

Hope this isn't a completely silly question (some folks say there's no such thing as a stupid question, but I don't know about that).

I've asked for assistance regarding this site before. It's a medical information site, which was created by someone else using tables. I'm helping the doctor clean up the site and organize it. We're leaving it as a tables site because I'm volunteering my time and I don't have the expertise to convert the whole thing to CSS. Anyway, instead of creating HTML pages for every topic, the original designer/webmaster created a number HTML pages with links to .doc, .rtf, and .pdf files.

I received from the doctor an updated article in .doc form to replace the original. The .doc is accessed via a link on this page: Hazardous Substances|Chemical Injury/Sensitivity. The link has this address:

http://www.chemicalinjury.net/HS/Per...tes)%20REV.doc

The original .doc had a different address/filename, so I thought I should redirect the old .doc to the new one because Google has indexed all of the .docs on this particular HTML page.

Here's the redirect I put into the .htaccess file:

redirect 301 /public_html/HS/Perfume Scented Products Website.doc http://www.chemicalinjury.com/public_html/HS/Perfume scented products and chemical injury ( phthalates) REV.doc

The redirect didn't work when I used a redirect checker I located on an SEO page I located through a search.

My question is: do 301 redirects work for .docs or only for HTML pages? If they do, what am I doing wrong?

Thanks!
__________________
Peter Drew
Peter Drew Voiceovers
Voiceovers for all electronic media
Reply With Quote
  #2 (permalink)  
Old 08-27-2007, 11:32 AM
wige's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,648
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: 301 redirect of .doc files

I think the problem may be with the filenames. spaces and parenthesis are not allowed in URLs, and are replaced with %20 for spaces, not sure offhand about parens. The redirect code for Apache also should not contain spaces in the urls. You will notice that spaces in redirect lines are used to seperate the old address from the new one - apache has no way of knowing where the old address ends and the new one begins.

You can try adding %20 to replace the spaces in the URLs at least. You may also want to look into changing the filenames to something a bit more server friendly, as well as converting the files to PDF format, because if the target of these documents is home users or patients, they may not have MS Word.
__________________
The best way to learn anything, is to question everything.
Reply With Quote
  #3 (permalink)  
Old 08-27-2007, 05:19 PM
WebProWorld Member
 
Join Date: Aug 2003
Location: Connecticut, USA
Posts: 68
pdrew RepRank 0
Default Re: 301 redirect of .doc files

Thanks, Wige!

With your explanation in hand, I'll go back and give it another go. Just wanted to make sure it didn't matter whether it's an .html page or any other file extension.

And your comment about .pdf files is a good one. Ideally, I'd like all of the .doc and .pdf files on this site to be actual .html pages, but that's a lot of work. When it's volunteer work, it has to be done bit by bit, so I can devote my time to making a living.

Cheers,
__________________
Peter Drew
Peter Drew Voiceovers
Voiceovers for all electronic media
Reply With Quote
  #4 (permalink)  
Old 08-27-2007, 05:32 PM
WebProWorld New Member
 
Join Date: Dec 2005
Posts: 11
heavener RepRank 0
Default Re: 301 redirect of .doc files

First of all, whenever you replace one document with another, I recommend that you simply give the new version the same filename as the older version. Then just replace the older file with the new one on the web server. That way you have no redirecting issues. Since the older file is already in the search engine index, it will continue to pop up as expected until the next time they index your site (about every six months). And if the content is about the same, it will continue to appear as expected.

That said, the way you redirect is to create a text file called .htaccess in the root of your website. In this file, you type the following syntax (replacing the appropriate places with your specific instances:

Redirect 301 /old page.html http://www.yoursite.com/newpage.html

Separate each redirect (you can have many) with a line feed (enter key). Also, be sure to separate the parts of the redirect line with spaces, not tabs. I made that mistake once and the whole thing stopped working.

You can create and save the .htaccess file using Windows notepad - however, certain versions of Apache don't like Windows ANSI. If you have an editor like HomeSite (and I think Dreamweaver) you should save it as true ASCII text.

There is one important caveat. Windows will refuse to save the file as .htaccess. It will demand a filename before the dot. You'll have to upload the filename.htaccess file and then use your FTP program (FileZilla, CuteFTP, WS-FTP Lite, etc.) to rename it and remove the filename part.

However, once the file is created and as you need to make changes, download it using FTP. Then, Windows will let you edit and save it each subsequent time without demanding the filename part. Weird, huh?

I've done this extensively with my website. As I redesign pages (new graphics, new menus, etc. same content), I give them new filenames and then redirect the old page to the new page. Since I can't FTP from work to my site to read my own .htaccess file right now, I got this information from 301 .htaccess Redirect Trick

Good luck.
Reply With Quote
  #5 (permalink)  
Old 08-27-2007, 05:36 PM
WebProWorld New Member
 
Join Date: Dec 2005
Posts: 11
heavener RepRank 0
Default Re: 301 redirect of .doc files

I just noticed the quoted syntax from that website has a space in the "old page.html" - as Peter mentioned, spaces aren't allowed. Not sure why that site is quoting syntax with breakage but the remaninder of the line is correct. Note that WebProWorld's blog parser automatically turned the last part of the line into a full link - that won't happen in your text file.

Michael
Reply With Quote
  #6 (permalink)  
Old 08-27-2007, 08:01 PM
Orion's Avatar
WebProWorld Veteran
WebProWorld MVP
 
Join Date: Sep 2003
Location: Halton Hills, ON
Posts: 702
Orion RepRank 4Orion RepRank 4Orion RepRank 4Orion RepRank 4
Default Re: 301 redirect of .doc files

also try removing /public_html from the URLs... they should not be needed in there for a .htaccess

the new file names.. use _ instead of spaces or nothing at all..

one more thing.. openoffice.org if you don't have adobe acrobat (not the reader the full program) to convert the .doc to pdf use openoffice.org it's free and you just need to open the file then save as pdf. done!
Reply With Quote
  #7 (permalink)  
Old 08-27-2007, 08:06 PM
WebProWorld Member
 
Join Date: Dec 2006
Location: Indianapolis
Posts: 41
modrewrite RepRank 0
Default Re: 301 redirect of .doc files

This works!

Code:
RedirectMatch 301 ^/HS/Perfume([^S]+)Scented([^P]+)Products([^W]+)Website.doc$ http://www.chemicalinjury.net/HS/Perfume$1scented$1products$1and$1chemical$1injury$1($1phthalates$1)$1REV.doc

I would say the best thing to do would be something similar to [url=http://www.askapache.com/htaccess/mod_rewrite-fix-for-caching-updated-files.html]version control[/ur]... basically you don't change the link in your documents, which is a HUGE benefit in terms of SEO, instead you rewrite the request internally on the server, which means the address stays the same, but the file served is different.

Code:
RewriteRule ^/?HS/Perfume([^S]+)Scented([^P]+)Products([^W]+)Website\.doc$ /HS/Perfume$1scented$1products$1and$1chemical$1injury$1($1phthalates$1)$1REV.doc [L]
__________________
de // AskApache.com blog
Reply With Quote
  #8 (permalink)  
Old 08-28-2007, 12:23 AM
WebProWorld Member
 
Join Date: Aug 2003
Location: Connecticut, USA
Posts: 68
pdrew RepRank 0
Default Re: 301 redirect of .doc files

More excellent advice. Orion and Modrewrite. Thanks for the tip about OpenOffice and .pdf files. I need a tool to do that short of buying the hefty-priced Adobe Acrobat.

Cheers,
__________________
Peter Drew
Peter Drew Voiceovers
Voiceovers for all electronic media
Reply With Quote
  #9 (permalink)  
Old 08-28-2007, 11:35 AM
wige's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,648
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: 301 redirect of .doc files

If you already have the latest version of MS Word (2007) it is able to save files as PDF as well. CutePDF - Create PDF for free, Free PDF Utilities, Edit PDF easily;. is a free print driver that converts almost any document type to a PDF file, easy to install and flexible.
__________________
The best way to learn anything, is to question everything.
Reply With Quote
Reply

  WebProWorld > Search Engines > Search Engine Optimization Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
php.ini files PilotPete IT Discussion Forum 1 11-13-2006 11:45 AM
.txt Files Needabed Search Engine Optimization Forum 1 07-28-2005 11:52 PM
pdf files CheckPoint Google Discussion Forum 1 10-27-2004 11:32 AM
.EXE files? info107 Web Programming Discussion Forum 4 01-19-2004 08:39 AM
tag files dbh_21 Graphics & Design Discussion Forum 0 12-15-2003 12:10 PM


All times are GMT -4. The time now is 09:07 PM.



Search Engine Optimization by vBSEO 3.3.0