|
08-26-2004, 07:06 PM | #1 |
Green Mole
Join Date: May 2004
Posts: 2
|
URLs containing single quotes
Hi everyone,
I'm trying to index a server that has a bunch of MSWord documents on it. The indexing works fine except until it reaches a file or directory name with single quotes in it. For example, when trying to index http://www.domain.com/pathtodocs/John's Resume/Resume.doc it would fail and return a 404 error because it tries to find http://www.domain.com/pathtodocs/Johns Resume/Resume.doc (Checked through observing Apache logs) Obviously quotes etc are being stripped out for sanity, but has anyone encountered this scenario before and what would be the best way to work around it? I'm happy to modify PHP code if someone can point me in the right direction but convincing 150 people to avoid using quotes and to find/change filenames etc containing single quotes would be an unlikely task. Look forward to any good suggestions! Cheers, Matt |
08-26-2004, 09:40 PM | #2 |
Purple Mole
Join Date: Jan 2004
Posts: 694
|
Short of finding and changing them all, as you say, you might try using a redirect in your .htaccess file, assuming you're on Linux. It would look like this for the example you gave:
Code:
Redirect /pathtodocs/Johns Resume/Resume.doc http://www.domain.com/pathtodocs/John's Resume/Resume.doc Let us know how it goes. |
08-26-2004, 10:03 PM | #3 |
Green Mole
Join Date: May 2004
Posts: 2
|
I think alternatively if anyone could point me to or provide a script that will scour through a directory tree and rename files to remove the ' I might just go with that method. Then anything that is missed will be indexed when I run that script periodically and rename anything with a single quote in the name.
Bloody consultants! |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Indexing single page as its own site | bloodjelly | Mod Requests | 3 | 10-15-2005 09:39 AM |
Can only index files in a single directory | gcrachel | Troubleshooting | 5 | 09-28-2004 07:23 AM |
Remove single pdf | motopsycho | How-to Forum | 2 | 04-30-2004 06:22 PM |
double quotes crash Phpdig | Rolandks | Bug Tracker | 8 | 10-24-2003 04:36 PM |
search phrases in quotes? | rediray | How-to Forum | 1 | 10-03-2003 07:39 PM |