Before I start, let me say that I have done quite a bit of research to figure this out, but I don't think I know enough about the question to find the solution.
In my .htaccess
I have a rewrite rule to send my wildcard subdomain to portal/index.php
with the subdomain as a get parameter.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{REQUEST_URI} !index\.php
RewriteCond %{HTTP_HOST} ^(.+?)\.mywebsite\.com$
RewriteRule .* /portal/index.php?sub_access=%1 [L]
This works perfectly, except for the fact I can no longer use $_GET
variables in my script. If I visit portal.mywebsite.com/login/?reset
, using var_dump()
always produces array(1) { ["sub_access"]=> string(6) "portal" }
Is there a way to append $_GET
variables to the generated one in my .htaccess? I'm sure I could do a work around of creating my own get variable capture by scraping the url, but I would much rather just not lose access to this feature.
I <3 $_GET