I'm of the understanding that Wordpress' .htaccess, like below:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
sends all queries through to the index.php (unless the filename exists on the server etc).
So, if I go to http://example.com/checkout
Wordpress rewrites that as http://example.com/index.php?pagename=checkout
.
But what I don't understand is that I have, at the top of a page template
<?php print_r($_GET) ?>
and when I navigate to http://example.com/checkout
that returns Array()
. I'd expect something like Array('pagename' => 'checkout')
;
How can I access the variables that Wordpress uses when handling a URL?