HTAccess - 重定向所有页面并获取数据

I have a quick question.

So I have my rule, which is;

RewriteRule    ^([a-z0-9\-\/]+)/?$    index.php?requested_page=$1    [NC,L]    # Handle requests.

How do I change this to forward any get data to the pages that get requested? Index.php is a template basically, that pulls in data from other pages depending on which URL is requested. The template is basically as follows;

         $sitePageHashMap = array(
                "home" => "home",
                "pretty-link" => "pagename",
                "pretty-link" => "pagename",
                "pretty-link" => "pagename"
            );

Thanks,

Harry

Use QSA flag:

RewriteRule ^([a-z0-9/-]+)/?$ index.php?requested_page=$1 [NC,L,QSA] 
  • QSA (Query String Append) flag preserves existing query parameters while adding a new one.