How to get data by $_GET on php, when i used .htac

2019-03-04 03:35发布

问题:

i have One problem on my small sites, the problem is on the URL. this is my URL :

http://example.com/by_location_directory_list_3.aspx?page=2

And on my PHP script, i want to show a data where it gets from $_GET[page]

i have do something, and something, no one works, any someone can help me? this is .HTACESS file

<IfModule mod_rewrite.c>
RewriteEngine on

RewriteRule ^by_location_directory_list_(.*)\.aspx$ template.php?option=directory_list&location=location&id=$1 [L]

Options All -Indexes
</IfModule>

the PHP script is

if(!empty($_GET['page'])){ echo "this on $_GET[page] page(s) "; }

回答1:

Use the QSA-tag, Query String Append: [QSA,L]

This will, if present, append the existing query string of the url to the redirected one.