httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Posts" <po...@2-tiersoftware.com>
Subject RE: [users@httpd] JOB: rewrite expert needed
Date Thu, 27 Mar 2003 20:32:20 GMT
Hi and thank you. 

After applying your suggestion, the browser returns a 400 "bad request"
error.

Question on the rule, does "." say to replace the whole url? Do I need
to also put the hostname or full path before getfile.php?

Thanks again,
Kawika

> -----Original Message-----
> From: Andrea Rossignoli [mailto:software@polin.it] 
> Sent: Thursday, March 27, 2003 12:05 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] JOB: rewrite expert needed
> 
> 
> Hi,
> with mod_rewrite you could use:
> 
> RewriteEngine On
> # Check if the file exits
> RewriteCond %{REQUEST_FILENAME} !-f
> # File not found, so redirect internally to getfile.php 
> RewriteRule . getfile.php?file=%{REQUEST_URI} [L]
> 
> but remember that doing that it will slow down every request 
> because it will check for every request if the file phiscally exists.
> 
> I'm not sure if that helped....
> 
> If I were you I'd play with Errordocument as already 
> suggested by Joshua. Inside error.php you can return a 200 
> status code using the header function of php. Also you can 
> decide to return an image from a php file too... 
> http://www.zend.com/zend/tut/dynamic.php
> 
> 
> :-) Andrea
> 
> 
> ----- Original Message -----
> From: "Posts" <posts@2-tiersoftware.com>
> To: <users@httpd.apache.org>
> Sent: Thursday, March 27, 2003 20:38
> Subject: RE: [users@httpd] JOB: rewrite expert needed
> 
> 
> > Refresh the page: errordocument actually sends the URL to the users 
> > browser not just the file which is what rewrite does, not going to 
> > work for this.
> >
> > The 2nd part is a result of using errordocument, any embedded URLs 
> > (ie: <img src="mydomain.com/images/goober.gif"> will not be 
> found. I 
> > want the rewrite command to change the request to 
> > "mydomain.com/getfile.php?file=/images/goober.gif" and that script 
> > would go get the real file.
> >
> > Been all over the rewrite guide and it has bit and pieces of what I 
> > want but not the whole solution.
> >
> > Hope that helps.
> >
> > Thanks,
> > Kawika
> >
> > > -----Original Message-----
> > > From: Joshua Slive [mailto:joshua@slive.ca]
> > > Sent: Thursday, March 27, 2003 11:29 AM
> > > To: users@httpd.apache.org
> > > Subject: RE: [users@httpd] JOB: rewrite expert needed
> > >
> > >
> > >
> > > On Thu, 27 Mar 2003, Posts wrote:
> > >
> > > > Hi, that won't work. I don't want to refresh the page 
> because the 
> > > > missing file could be an html file with images that are 
> also not 
> > > > found.
> > >
> > > I have no idea what you mean, either by "refresh the 
> page" or by the 
> > > second part of that sentence.  The obvious mod_rewrite 
> answers is to 
> > > adapt the "Search Pages in More Than One Directory" section of
> > > http://httpd.apache.org/docs-> 2.0/misc/rewriteguide.html
> > >
> > >
> > > Joshua.
> > >
> > >
> > > 
> --------------------------------------------------------------------
> > > -
> > > The official User-To-User support forum of the Apache HTTP
> > > Server Project. See
> > > <URL:http://httpd.apache.org/userslist.html> for more info.
> > > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> > >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > > For additional commands, e-mail: users-help@httpd.apache.org
> > >
> >
> >
> > 
> ---------------------------------------------------------------------
> > The official User-To-User support forum of the Apache HTTP Server 
> > Project. See <URL:http://httpd.apache.org/userslist.html> for more 
> > info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP 
> Server Project. See 
> <URL:http://httpd.apache.org/userslist.html> for more info. 
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message