[Pmwiki-users] upload problem in pmwiki 0.6.5 with mod_rewrite for nicer urls

Hugo Fjelsted Alrøe Hugo.Alroe
Mon Mar 1 03:24:38 CST 2004


I get an error when going to my uploaded files saying that 
> PmWiki can't process your request
> 'Somegroup/somefile.txt' is not a valid PmWiki page name
though the uploaded files are where they are supposed to be. 

I think this is due to that I am using the Apache mod_rewrite for shorter/nicer urls (http://www.pmichaud.com/wiki/PmWiki/ChangePmWikiURL)
What seems to happen is that the group subdirectories in the uploads directory, which are with a capital first character, get processed by mod_rewrite and this creates a malfunction. I tried copying the Main/test2.txt upload (here, http://ecowiki.org/uploads/Main/test2.txt, gives error) to main/test2.txt (here http://ecowiki.org/uploads/main/test2.txt, works fine). 

My root .htaccess file says:
RewriteEngine on
RewriteBase /
RewriteRule ([A-Z].*) /home/sv_ecowikiorg/pmwiki/pmwiki.php?pagename=$1&%{QUERY_STRING} [L]

I looked into the mod_rewrite documentation, but it is quite complex. I did try changing RewiteBase to /pmwiki/, but this did not work (gave a 404 Not Found error).

I also tried moving the rewrite commands to a .htaccess file in the pmwiki directory, but this made all the existing links invalid.

Any ideas on how to change the rewrite commands so that uploads work?
Regards, Hugo, www.ecowiki.org


> -----Oprindelig meddelelse-----
> Fra: Hugo Alr?e 
> Sendt: 1. marts 2004 08:09
> Til: Patrick R. Michaud
> Cc: Hugo Fjelsted Alr?e
> Emne: Re: upload problem in pmwiki 0.6.5
> 
> 
> Thank you for your reply, Patrick. 
> I did infact set the full url, and the uploads are located in 
> my root directory where they should be. (I attach htaccess 
> and config.php if you need them). 
> 
> What seems to happen is that the group subdirectories in the 
> uploads directory, which are with a capital first character, 
> get processed by mod_rewrite and this creates a malfunction. 
> I tried copying the Main/test2.txt upload (here, 
> http://ecowiki.org/uploads/Main/test2.txt, gives error) to 
> main/test2.txt (here 
> http://ecowiki.org/uploads/main/test2.txt, works fine). But I 
> don't really know what to do about it - probably restrict 
> mod_rewrite to the pmwiki directory, but how?
> 
> (I shiftet uploads password to empty)
> 
> Kind regards
> Hugo
> ----- Original Message ----- 
> From: "Patrick R. Michaud" 
> To: "Hugo Alr?e" 
> Sent: Monday, March 01, 2004 12:23 AM
> Subject: Re: upload problem in pmwiki 0.6.5
> 
> 
> > You probably need to set the $UploadUrlFmt variable to be the url
> > that should be used to access your upload directory.  
> Normally PmWiki
> > computes this URL from the location of the pmwiki.php 
> script, but since
> > you're using the mod_rewrite replacement you'll probably 
> have to specify
> > it explicitly (as the computed default would place it in 
> the root of 
> > your html directory tree).
> > 
> > Pm
> > 
> > On Sun, Feb 29, 2004 at 11:31:19PM +0100, Hugo Alr?e wrote:
> > > Dear Patrick
> > > I hope I am not being stupid again, but I cannot see the 
> uploads I have made. See for instance
> > > http://ecowiki.org/GlobalPerspective/TestPage or
> > > http://ecowiki.org/Main/WikiSandbox
> > > 
> > > I get the following error when clicking on the link to the file:
> > > PmWiki can't process your request
> > > 'GlobalPerspective/global_perspective_proposal.pdf' is 
> not a valid PmWiki page name
> > > 
> > > We are sorry for any inconvenience.
> > > 
> > > Any idea on what is wrong? (the upload password is upload)
> > > (I am using the Apache mod_rewrite for shorter/nicer urls)
> > > 
> > > Kind regards
> > > Hugo
> 



More information about the pmwiki-users mailing list