FreePgs.com Forum

FreePgs Related => Support Requests => Topic started by: sixthcrusifix on January 09, 2006, 12:19:43 PM

Title: .htacess Question -Reading .tpl as .php
Post by: sixthcrusifix on January 09, 2006, 12:19:43 PM
somone gave me this before but I lost it. I need to have a .htaccess file that will make a file with the extension .tpl read as a PHP file because setting PHP to execute on all extentions isn't working for .tpl but the .htaccess will.

Title: Re: .htacess Question -Reading .tpl as .php
Post by: GP™ on January 09, 2006, 06:19:29 PM
Add this to .htaccess

AddType application/x-httpd-php .tpl
Title: Re: .htacess Question -Reading .tpl as .php
Post by: sixthcrusifix on January 10, 2006, 01:32:51 AM
Quote from: gordon on January 09, 2006, 06:19:29 PM
Add this to .htaccess

AddType application/x-httpd-php .tpl

thank you :D

Can I just put that in the ROOT Directory or do I have to put that in the drectory that the .tpl Files are in??
Also: I can just put that right? I don't have to put rewrite rule one or anything do I ? I'll try it out and see maybe I'll answer my own questions.
Title: Re: .htacess Question -Reading .tpl as .php
Post by: Ben on January 10, 2006, 02:28:23 AM
You can put it in any directory if you want, that's where I keep almost all of my .htaccess commands.
And that line as it is should work fine, just keep it on it's own line and make sure the rest of your file is valid

(And this is my first post in awhile.. yay!)
Title: Re: .htacess Question -Reading .tpl as .php
Post by: GP™ on January 10, 2006, 03:02:51 AM
Yes, you can place in in your root dir, and yes, all thats required to phase your TPL files to php is that one line.
Keep in mind all .TPL files will be phased for php, even if there just html..

L8r,
Gordon

PSST. Congrads nq2h on your post ;)
Title: Re: .htacess Question -Reading .tpl as .php
Post by: webzone (archived) on January 11, 2006, 02:26:14 AM
Indeed, as both gordon and nq2h said, the rule will apply and the directory where you put the .htaccess is not important.

I'd just like to make it even clearer (it hasn't been said yet) :

All commands you place in .htaccess will apply to all the files in the same directory as .htaccess and all subdirectories. This statement is valid for all commands and rewrite rules. So if you put .htaccess in /a, all its rules will apply to /a, /a/b, /a/b/c and so on.
Title: Re: .htacess Question -Reading .tpl as .php
Post by: sixthcrusifix on January 11, 2006, 09:23:23 AM
Quote from: webzone on January 11, 2006, 02:26:14 AM
Indeed, as both gordon and nq2h said, the rule will apply and the directory where you put the .htaccess is not important.

I'd just like to make it even clearer (it hasn't been said yet) :

All commands you place in .htaccess will apply to all the files in the same directory as .htaccess and all subdirectories. This statement is valid for all commands and rewrite rules. So if you put .htaccess in /a, all its rules will apply to /a, /a/b, /a/b/c and so on.

so if I ONLY want it to apply to a sincle directory in root I'd put another .htaccess file in THAT directory?

Also if I have a .htaccess file in root/MAIN and one in root, will teh one in root still effect teh one in root/MAIN too?
Title: Re: .htacess Question -Reading .tpl as .php
Post by: GP™ on January 11, 2006, 06:45:49 PM
If you place the .htaccess file in your root directory it will effect the entire sub folders.
if you place it in /root/example then it will effect only example and the sub folders under it.

So if you palce your htaccess file in your root you will be able to use tpl files in any folder on your site..