This supposed to be a "robots exclusion code" for a traffic stat widget plugin (WordPress). RewriteRule robots\.txt robots.php RewriteRule robots.txt robots.php Code (markup): Are these two lines of code the same? Which should be put on a .htaccess file? It works with this line of code robots.php that is put on the root directory <?php session_start(); $_SESSION['wtcrobot'] = 1; echo file_get_contents('robots.txt'); exit; ?> Code (markup):
Why would you even do that other than making code bloat... since the overhead of running PHP and the extra request handling on a static file not only takes more time, but would also not work since most bots don't preserve cookies and as such cannot maintain a session!?! (since sessions use ONE cookie to work) Doesnae make much sense; in fact looks totally banjaxed. Exit for nothing, echoing a file_get_contents instead of using readFile, session that shouldn't work given the target file...