What's the Practical Difference between Use of PHP and .htaccess?
bigdealioo
5:10 pm on Sep 2, 2006 (gmt 0)
For example, both can be used to do server-side redirection. Now what are the practical difference? And advantages/disadvantages for using each?
FalseDawn
6:32 pm on Sep 2, 2006 (gmt 0)
You are comparing apples and oranges really. Being "part" of apache, htaccess commands are executed well before the PHP script, and so can do things that PHP is not able to - like URL rewriting, directory protection etc.
If all you are considering is simple redirection, then there isn't much difference - apart from that using PHP is less efficient as the PHP module will need to be loaded into memory just to perform the redirect.