|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| 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
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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! |
|
|||
|
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, |
|
|||
|
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. |
|
|||
|
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 |
|
||||
|
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!
__________________
Ron Boyd website consulting (design, optimization, marketing) :: Follow Me: @orionsweb |
|
|||
|
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] |
|
|||
|
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, |
|
||||
|
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. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
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 |
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |