PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Troubleshooting

Reply
 
Thread Tools
Old 08-26-2004, 07:06 PM   #1
mmaattttt
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
mmaattttt is offline   Reply With Quote
Old 08-26-2004, 09:40 PM   #2
vinyl-junkie
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
It's possible that doing this might throw phpdig into a loop, so you might want to watch it while it runs.

Let us know how it goes.
vinyl-junkie is offline   Reply With Quote
Old 08-26-2004, 10:03 PM   #3
mmaattttt
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!
mmaattttt is offline   Reply With Quote
Reply


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 Off
HTML code is Off
Forum Jump

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


All times are GMT -8. The time now is 10:36 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.