![]() |
Is using PHP faster than htaccess?
Say I wanted to 301 redirect traffic to different page depending on HTTP referer, will using PHP be better?
Under high traffic (200k uniques per day). |
you wouldnt think so since .htaccess is a coded part of apache and other web servers, i never have tried, give it a try and see how it works out.
|
.htaccess should be faster...
|
If possible, modify your apache VirtualHost which would be the fastest since it's not checked on each page request. However, I'm not 100% certain that the .htaccess file is.
So don't read this post, because I dunno what I'm saying. Sorry. :( |
htaccess is much faster than php, at the (small) expense of having to run mod_rewrite
|
Php doesnt stand a chance
|
If you can (dedicated server for example), put anything "permanent" into your web server config file and not the htaccess file... the htaccess file has to be loaded for each request... That will be the absolute fastest.
|
put the config line in httpd.conf first - this is faster because the settings are loaded into memory after apache was started. unlike .htaccess which are loaded everytime the page is access.
php vs htaccess = i think php, but not 100% sure |
Quote:
|
I have absolute no clue about it....but it would be interesting to find out...
|
can i have an image directory protected from the httpd.conf instead with an .htaccess file when the .htaccess file in the domain.com/images/ directory looks like:
RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain\.com/ [NC RewriteCond %{HTTP_REFERER} !^$ RewriteRule \.(jpe?g|gif|bmp|png)$ http://www.domain.com/ [L] and what would that code be? many thanx. |
there is a lot you can do with mod_rewrite.
you can go really deep into it. there are some really good docs on it |
All times are GMT -7. The time now is 06:56 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123