PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > alt.apache.configuration > Mod Rewrite?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
alt.apache.configuration Apache web server configuration issues.

Mod Rewrite?

Réponse
 
LinkBack Outils de la discussion
Vieux 13/01/2008, 00h32   #1
Trammel
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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


  Réponse avec citation
Vieux 13/01/2008, 06h35   #2
Davide Bianchi
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Mod Rewrite?

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

--
If Microsoft were to vanish, who would we hate next?
-- From a Slashdot.org post
  Réponse avec citation
Vieux 13/01/2008, 14h00   #3
Trammel
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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


  Réponse avec citation
Vieux 14/01/2008, 09h47   #4
phantom
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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


  Réponse avec citation
Vieux 15/01/2008, 20h32   #5
Trammel
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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.


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 09h55.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,16178 seconds with 13 queries