Mod Rewrite?

Mod Rewrite?

am 13.01.2008 01:32:28 von Trammel

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 :)

Re: Mod Rewrite?

am 13.01.2008 07:35:32 von unknown

Post removed (X-No-Archive: yes)

Re: Mod Rewrite?

am 13.01.2008 15:00:45 von Trammel

"Davide Bianchi" wrote in message
news:slrnfojcc0.34h.davideyeahsure@fogg.onlyforfun.net...
> On 2008-01-13, Trammel 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 :(

Re: Mod Rewrite?

am 14.01.2008 10:47:58 von phantom

"Trammel" wrote in message
news:hQoij.131959$036.77436@fe1.news.blueyonder.co.uk...
> "Davide Bianchi" wrote in message
> news:slrnfojcc0.34h.davideyeahsure@fogg.onlyforfun.net...
>> On 2008-01-13, Trammel 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/mod_rewrite.html#rewrit erule

Re: Mod Rewrite?

am 15.01.2008 21:32:43 von Trammel

"phantom" wrote in message
news:idGij.77151$c_1.44795@text.news.blueyonder.co.uk...
> "Trammel" wrote in message
> news:hQoij.131959$036.77436@fe1.news.blueyonder.co.uk...
>> "Davide Bianchi" wrote in message
>> news:slrnfojcc0.34h.davideyeahsure@fogg.onlyforfun.net...
>>> On 2008-01-13, Trammel 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/mod_rewrite.html#rewrit erule

Thanks.
I was having a problem finding that info.