我创建的url如下:
exampledotcom/index.php?c=2
至
Exampledot.com/any/2
我想在http://example.com/any/2?p=1中使用url来获取变量'p‘。
并且不想为get变量'p‘随意使用url。
有可能吗?
这是我在.htaccess中的代码:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^([a-zA-Z]+)/(.*)$ ./index.php?c=$2
发布于 2017-03-07 22:17:30
您希望添加QSA
标志,以便现有的查询字符串不会被丢弃,而是保留并与您在重写目标中指定的新字符串合并。
有关更多详细信息,请参阅http://httpd.apache.org/docs/2.2/rewrite/flags.html#flag_qsa
https://stackoverflow.com/questions/42650534
复制相似问题