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

我只是一个虾纸丫 提交于 2019-12-31 05:11:10

问题


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.



来源:https://stackoverflow.com/questions/17537536/how-to-get-data-by-get-on-php-when-i-used-htaccess

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!