LocationMatch - RegEx
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > LocationMatch - RegEx




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    LocationMatch - RegEx  
Kevin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-31-07 12:27 AM

Hi,

Can someone help me with a regex to pass every image file except
some_file.gif in Apache ? The current directive I have is given below
-

<LocationMatch /some_url/.+\.(gif|jpg|png)$>
SetHandler default
</Location>

Thanks,
Kevin.






[ Post a follow-up to this message ]



    Re: LocationMatch - RegEx  
shimmyshack


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-31-07 12:22 PM

On 31 Jan, 00:49, "Kevin" <kejos...@hotmail.com> wrote:
> Hi,
>
> Can someone help me with a regex to pass every image file except
> some_file.gif in Apache ? The current directive I have is given below
> -
>
> <LocationMatch /some_url/.+\.(gif|jpg|png)$>
>    SetHandler default
> </Location>
>
> Thanks,
> Kevin.

what are you trying to do? do you mean you wish to parse one
particular gif, so you can have php in there save as a gif and esnd
back an image, one of those avatars which changes or something?
If so, consider using a rewrite that rewrites one particular gif onto
a php file but does it internally so that the url ends with gif but
the content is served from the script.
(rather than parsing a gif which is actually a code file, besides your
editor might not like the extension, and it will be more hassle for
you anyway)






[ Post a follow-up to this message ]



    Re: LocationMatch - RegEx  
Kevin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-31-07 06:19 PM

Thanks for replying - the setup I have is a bit more complex and hence
I did not specify the details earlier. I have a Java application
server at the backend and want Apache (as front-end web server) to
serve static content. However, due to the way the application is
setup, certain gif files do not work if they are served by Apache.
Hence, I need a way to have Apache exclude a couple of these gif
images and process the remainder. I hope this helps explain my earlier
query.

Kevin.






[ Post a follow-up to this message ]



    Re: LocationMatch - RegEx  
shimmyshack


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-01-07 12:21 AM

On 31 Jan, 16:57, "Kevin" <kejos...@hotmail.com> wrote:
> Thanks for replying - the setup I have is a bit more complex and hence
> I did not specify the details earlier. I have a Java application
> server at the backend and want Apache (as front-end web server) to
> serve static content. However, due to the way the application is
> setup, certain gif files do not work if they are served by Apache.
> Hence, I need a way to have Apache exclude a couple of these gif
> images and process the remainder. I hope this helps explain my earlier
> query.
>
> Kevin.

heres how you get a reg exp for files you might want to do something
with,
http://httpd.apache.org/docs/2.2/mo...html#filesmatch
<FilesMatch "\.(gif|jpe?g|png)$">
</FilesMatch>


I suppose I was asking what are you trying to do, maybe I'm being slow
but I can't see _what_ you are trying to achieve, we know that the
files are being mangled, so are you just going to stop them from being
public? If you dont wish people to see them, then use.

<FilesMatch "\.(gif|jpe?g|png)$">
Order Allow,Deny
</FilesMatch>

this will stop them from being served, adjust your reg exp to suit.







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:34 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register