Re: Newbie Question
| From: | Joshua Kehn | Date: | Sun, 02 Jan 2011 18:02:22 +0000 |
| Subject: | Re: Newbie Question | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-310453@lists.php.net to get a copy of this message | ||
On Jan 2, 2011, at 12:50 PM, <admin@buskirkgraphics.com> wrote:
> The question was "The .php extension is a requirement?"
>
> The answer is no.
>
> While me and Ash may completely disagree on the php parser, the simple answer is there are many
> ways around running a non .php extension file in php.
>
>
> mod_rewrite rules in .htaccess files are interpreted for each request and CAN slow down things
> if your traffic is high.
>
> Having said that, mod_rewrite in httpd.conf is faster because it is compiled at server restart
> and it is native to the server.
>
> As a beginner, I completely agree with ash on bad practice rule of thumb. You will simply
> rewrite the html file later on wishing you had never did the hack to make it function.
>
> Richard L. Buskirk
> Sorry, here is the code. The .php extension is a requirement? Can't it b embedded on a
> .html file?
_This_ question when asked from a beginner requires a non-confusing answer of "yes."
> Can't it be embedded on a .html file?
PHP is always embedded alongside HTML code within <?php ?> tags. It's not embedded inside
a .html file as the extension should indicate the file type. Adding a mod_rewrite rule (as you
suggest) can lead to confusion later on in development. At the very least you'll look stupid
re-asking "Can't it be embedded..."
Regards,
-Josh
____________________________________
Joshua Kehn | Josh.Kehn@gmail.com
http://joshuakehn.com