View Single Post
  #7 (permalink)  
Old 08-27-2007, 08:06 PM
modrewrite modrewrite is offline
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