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:


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:
    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 mod_suphp.c>
        suPHP_UserGroup dot dot
    <IfModule !mod_disable_suexec.c>
        <IfModule !mod_ruid2.c>
           SuexecUserGroup dot dot
    <IfModule mod_ruid2.c>
       RUidGid dot dot
    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

1 Answer

+2 votes
answered Sep 2, 2013 by prix

To capture:


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
Welcome to Q&A, where you can ask questions and receive answers from other members of the community.
Website Online Counter