【问题标题】:how to get url value in .htaccess如何在.htaccess中获取url值
【发布时间】:2016-01-14 19:05:09
【问题描述】:
RewriteEngine On
RewriteRule  ^Assamese/([0-9a-zA-Z]+) assamese.php?gender=$1 [NC,L]
RewriteRule  ^Assamese/([0-9a-zA-Z]+)/([0-9a-zA-Z]+) assamese.php?gender=$1&alp=$2 [NC,L]

【问题讨论】:

  • 我得试试这个还不行的情况。请帮帮我
  • 如果我可以同时使用 RewriteRule.i 将获得第一个规则,但尚未获得该页面中两个值的第二个规则参数。

标签: php .htaccess url get


【解决方案1】:

您可以从 PHP 的 $_SERVER 超级全局访问 URL,特别是 REQUEST_URI 索引。

例如:

echo $_SERVER['REQUEST_URI'];

此超全局变量/值的完整列表(包括主机名、路径等)位于 this page in the PHP docs

您可能还会发现this stack overflow answer 很有价值。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-29
    • 2012-05-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-25
    相关资源
    最近更新 更多