PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > comp.info.servers.unix > Locate all files of certain filetype to a specific folder?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.info.servers.unix Web servers for UNIX platforms.

Locate all files of certain filetype to a specific folder?

Réponse
 
LinkBack Outils de la discussion
Vieux 16/03/2005, 13h34   #1
Aapo V
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Locate all files of certain filetype to a specific folder?

Hi there,

Is it possible to make so that every time a script or user calls a
script ending with ".tpl", the server would automatically search the
file from a specific folder?

eg if on /public_html/index.php I call "news.tpl" it would get the
news.tpl file from the /public_html/php/tpl/ -folder.

And the same if the news.tpl is called from
public_html/something/nothing/index.php.

I could just always use the absolute paths to the .tpl-files but I would
prefer more to skip writing the abs path every time...

-AV
  Réponse avec citation
Vieux 16/03/2005, 15h01   #2
Tim
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Locate all files of certain filetype to a specific folder?

Aapo V <aapo@roc.fi> posted:

> Is it possible to make so that every time a script or user calls a
> script ending with ".tpl", the server would automatically search the
> file from a specific folder?
>
> eg if on /public_html/index.php I call "news.tpl" it would get the
> news.tpl file from the /public_html/php/tpl/ -folder.
>
> And the same if the news.tpl is called from
> public_html/something/nothing/index.php.
>
> I could just always use the absolute paths to the .tpl-files but I would
> prefer more to skip writing the abs path every time...


It'd be less work for the server if it didn't have to rewrite URIs, or
redirect the browser, on every request. You could use an alias, if you'd
just like to shorten what you had to use as an absolute URI.

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please delete some files yourself.
  Réponse avec citation
Vieux 17/03/2005, 10h28   #3
Aapo V
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Locate all files of certain filetype to a specific folder?

Tim wrote:
> Aapo V <aapo@roc.fi> posted:
>
> It'd be less work for the server if it didn't have to rewrite URIs, or
> redirect the browser, on every request. You could use an alias, if you'd
> just like to shorten what you had to use as an absolute URI.
>


As a total newbie with aliases, what kind of an alias must I use here?

Alias *.tpl "/usr/local/blabla/*.tpl" propably won't work...

AV
  Réponse avec citation
Vieux 17/03/2005, 12h08   #4
Tim
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Locate all files of certain filetype to a specific folder?

Tim wrote:

>> It'd be less work for the server if it didn't have to rewrite URIs, or
>> redirect the browser, on every request. You could use an alias, if you'd
>> just like to shorten what you had to use as an absolute URI.



Aapo V <aapo@roc.fi> posted:

> As a total newbie with aliases, what kind of an alias must I use here?
>
> Alias *.tpl "/usr/local/blabla/*.tpl" propably won't work...


Aliases work by providing a faked path, what you've just typed in is still
a rewrite (which can be done, but involves all the extra server activity
that I just mentioned).

So, say that you have your .tpl files in:
/var/www/html/very/long/path/you/hate/typeing/here/it/

e.g. /var/www/html/very/long/path/you/hate/typing/here/is/it.tpl
/var/www/html/very/long/path/you/hate/typing/here/is/another.tpl
/var/www/html/very/long/path/you/hate/typing/here/is/more.tpl

You'd set an alias for that long path like this:

Alias /longpath /var/www/html/very/long/path/you/hate/typing/here/it/

And, in the HTML, your HREFs would be something like:

<a href=/longpath/it.tpl">is</a>
<a href=/longpath/another.tpl">another</a>
<a href=/longpath/more.tpl">more</a>

Meaning far less typing for you, and a simple life for the server.

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please delete some files yourself.
  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 09h14.


É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,08860 seconds with 12 queries