Empty $_GET params altough QSA flag next to rewrite rule in .htaccess

0 votes
asked Sep 2, 2013 by prodraz

I've tried various solutions posted here on stackoverflow, none of them seemed to work.

I really wonder what am I missing here, currently .htaccess looks like this:

RewriteEngine On
RewriteRule ^register/?$ ./register.php?reference=$1 [L,QSA]

I'm getting URL like this:

domain.com/register/ENIGMA-45

That's all good, but $_GET param don't pass.

I've tried to print_r($_GET) and print($_SERVER['QUERY_STRING]); both are empty.

VirtualHost config:
<VirtualHost 199.99.99.99:82>
    ServerName dot.magicaldomain.com
    ServerAlias www.dot.magicaldomain.com
    DocumentRoot /home/dot/public_html
    ServerAdmin webmaster@dot.magicaldomain.com
    ## User dot # Needed for Cpanel::ApacheConf
    <IfModule mod_userdir.c>
        Userdir disabled
        Userdir enabled dot 
    </IfModule>
    <IfModule mod_suphp.c>
        suPHP_UserGroup dot dot
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        <IfModule !mod_ruid2.c>
           SuexecUserGroup dot dot
        </IfModule>
    </IfModule>
    <IfModule mod_ruid2.c>
       RUidGid dot dot
    </IfModule>
    CustomLog /usr/local/apache/domlogs/dot.magicaldomain.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    CustomLog /usr/local/apache/domlogs/dot.magicaldomain.com combined
    Options -ExecCGI -Includes
    RemoveHandler cgi-script .cgi .pl .plx .ppl .perl
</VirtualHost>

1 Answer

+2 votes
answered Sep 2, 2013 by prix

To capture:

domain.com/register/ENIGMA-45

You can use this:

Options +FollowSymLinks -MultiViews

RewriteEngine On
RewriteBase /

RewriteRule ^register/?([^/]*|)/?$ /register.php?reference=$1 [L]

Add this to your virtualhost:

<Directory "/home/dot/public_html">
    Options -Indexes FollowSymLinks +ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
Welcome to Q&A, where you can ask questions and receive answers from other members of the community.
Website Online Counter

...