Mod Rewrite?

This is a discussion on Mod Rewrite? within the Apache Web Server forums, part of the Web Server and Related Forums category; I have some user-created images that I wish to host/serve but only for as long as people actually ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-13-2008
Trammel
 
Posts: n/a
Default Mod Rewrite?

I have some user-created images that I wish to host/serve but only for as
long as people actually use them. I have came-up with the idea of using PHP
to "touch" the files and change the files "modified on" date. This will
enable me to see which files arent being used anymore and delete them from
my server.

In order to do this, I need apache to rewrite say:
*.jpg

to:
filemod.php?file=*.jpg

I think that this would need a rewrite in a .htaccess file residing in the
..jpg's specific folder (.jpgs in other folders dont need processed) but
having never done a rewrite and not really knowing what all the symbols
do... I would like to know how I do this... how it should look... and most
importantly... why? (What each symbol or group of symbols mean)

Sorry this is alot to ask... but thanks for reading :)


  #2 (permalink)  
Old 01-13-2008
Trammel
 
Posts: n/a
Default Re: Mod Rewrite?

"Davide Bianchi" <davideyeahsure@onlyforfun.net> wrote in message
news:slrnfojcc0.34h.davideyeahsure@fogg.onlyforfun .net...
> On 2008-01-13, Trammel <Me@Server.com> wrote:
>> I have some user-created images that I wish to host/serve but only for as
>> long as people actually use them. I have came-up with the idea of using
>> PHP
>> to "touch" the files and change the files "modified on" date. This will
>> enable me to see which files arent being used anymore and delete them
>> from
>> my server.

>
> I've a better idea: check in the log files. When an image doesn't show
> up anymore for a couple of days you can delete it.
>
> Davide
>


I'd rather learn how to use the built-in methods of Apache (namely rewrite)
to let me do more processing than a simple log-watcher is capable of doing.
Then the same thing script could be used for instance to deny images if the
referer isnt in my domain, only allow access to images if the person is
logged-in, etc.

If there is anyone reading that knows how to use Apache's rewrite
function/method then please read the original post.
This reply wasnt a viable alternative, sorry :(


  #3 (permalink)  
Old 01-14-2008
phantom
 
Posts: n/a
Default Re: Mod Rewrite?

"Trammel" <Me@Server.com> wrote in message
news:hQoij.131959$036.77436@fe1.news.blueyonder.co .uk...
> "Davide Bianchi" <davideyeahsure@onlyforfun.net> wrote in message
> news:slrnfojcc0.34h.davideyeahsure@fogg.onlyforfun .net...
>> On 2008-01-13, Trammel <Me@Server.com> wrote:
>>> I have some user-created images that I wish to host/serve but only for
>>> as
>>> long as people actually use them. I have came-up with the idea of using
>>> PHP
>>> to "touch" the files and change the files "modified on" date. This will
>>> enable me to see which files arent being used anymore and delete them
>>> from
>>> my server.

>>
>> I've a better idea: check in the log files. When an image doesn't show
>> up anymore for a couple of days you can delete it.
>>
>> Davide
>>

>
> I'd rather learn how to use the built-in methods of Apache (namely
> rewrite) to let me do more processing than a simple log-watcher is capable
> of doing. Then the same thing script could be used for instance to deny
> images if the referer isnt in my domain, only allow access to images if
> the person is logged-in, etc.
>
> If there is anyone reading that knows how to use Apache's rewrite
> function/method then please read the original post.
> This reply wasnt a viable alternative, sorry :(


If you want to learn then start here:
http://httpd.apache.org/docs/2.2/mod...ml#rewriterule


  #4 (permalink)  
Old 01-15-2008
Trammel
 
Posts: n/a
Default Re: Mod Rewrite?

"phantom" <nobody@blueyonder.invalid> wrote in message
news:idGij.77151$c_1.44795@text.news.blueyonder.co .uk...
> "Trammel" <Me@Server.com> wrote in message
> news:hQoij.131959$036.77436@fe1.news.blueyonder.co .uk...
>> "Davide Bianchi" <davideyeahsure@onlyforfun.net> wrote in message
>> news:slrnfojcc0.34h.davideyeahsure@fogg.onlyforfun .net...
>>> On 2008-01-13, Trammel <Me@Server.com> wrote:
>>>> I have some user-created images that I wish to host/serve but only for
>>>> as
>>>> long as people actually use them. I have came-up with the idea of
>>>> using PHP
>>>> to "touch" the files and change the files "modified on" date. This
>>>> will
>>>> enable me to see which files arent being used anymore and delete them
>>>> from
>>>> my server.
>>>
>>> I've a better idea: check in the log files. When an image doesn't show
>>> up anymore for a couple of days you can delete it.
>>>
>>> Davide
>>>

>>
>> I'd rather learn how to use the built-in methods of Apache (namely
>> rewrite) to let me do more processing than a simple log-watcher is
>> capable of doing. Then the same thing script could be used for instance
>> to deny images if the referer isnt in my domain, only allow access to
>> images if the person is logged-in, etc.
>>
>> If there is anyone reading that knows how to use Apache's rewrite
>> function/method then please read the original post.
>> This reply wasnt a viable alternative, sorry :(

>
> If you want to learn then start here:
> http://httpd.apache.org/docs/2.2/mod...ml#rewriterule


Thanks.
I was having a problem finding that info.


 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:37 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0