|
|
|
|
||||||
| comp.info.servers.unix Web servers for UNIX platforms. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
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. |
|
![]() |
| Outils de la discussion | |
|
|