I ended up not getting the informed ways and the page always loads PHP first :... So I put a code at the top of my PHP that checks if I passed (in the url) a value 'true' for the variable 'testing' and, if YES, it loads my PHP, otherwise (if I pass nothing) it redirects to my index.html. Follow the code below for anyone else who needs something like this :P
<?php
if($_GET['testing'] != 'true'){ ?>
<html>
<head>
<meta http-equiv="refresh" content="0; url=http://example.com/index.html" />
</head>
</html>
<?php } else {
/* aqui o código PHP */
} ?>
That way, it loads my HTML if I enter the URL example.com
, but if I get in example.com/?testing=true
it carries my PHP.
Thanks for the support! :)
As much as this is an example, if the intention is to actually test something it would be better to have a directory only for testing and out of public access, if not another server really, one for production and another for testing. ;)
– Inkeliz