.htaccess debug in php

Sure. Create this sort of .php file (echo.php):
<?php
phpinfo(INFO_VARIABLES);
?>
Add this rule in .htaccess:
RewriteEngine On
RewriteCond %{REQUEST_URI} !echo.php
RewriteRule .* echo.php?ua=%{HTTP_USER_AGENT}&https=%{HTTPS} [L]
Add more parameters if necessary.
Now call any URL and check the output (the GET parameters should be on the top of table).
But, TBH, almost all of this info is received by Apache and is available to PHP anyway: look at $_SERVER.
Main Source : https://stackoverflow.com/questions/6861534/is-it-possible-to-output-any-or-all-available-variables-in-a-htaccess-file

Was this article helpful?

Leave A Comment?

You must be logged in to post a comment.