【问题标题】:htaccess mod rewrite with smf forum url not workinghtaccess mod 用 smf 论坛 url 重写不工作
【发布时间】:2015-07-28 21:37:13
【问题描述】:

我在尝试重定向 htaccess 文件中的 url 时遇到问题

我正在尝试从下面的这个 url 重定向,(u=6 将是随机数)

index.php?action=profile;u=6

到

index.php?action=pm

 RewriteEngine on

 RewriteRule ^index.php?action=profile;u=/([^/]*)$ index.php?action=pm

我尝试了很多不同的变化,但我似乎无法让它发挥作用

我在目录下安装了应用程序

/消息

我尝试对 /root 和 /messages 目录中的 htaccess 文件进行所有更改,但没有 aval,任何帮助将不胜感激,提前感谢您的时间

【问题讨论】:

  • 两个问题。 “u”是标准的 url 参数吗? “m”从何而来?
  • 你好,你是用户,即 u=3 或 u=234 等等 - action=pm,这是私信系统的链接

标签: php apache .htaccess mod-rewrite redirect


【解决方案1】:

尝试:

RewriteEngine on
RewriteCond %{QUERY_STRING} ^action=profile;u=\d+ [NC]
RewriteRule ^index\.php$ index.php?action=pm [NC,L]

【讨论】:

    【解决方案2】:

    试试这个:

    重写规则 ^index.php\?action=profile;u=([0-9])+$ index.php?action=pm

    【讨论】:

      猜你喜欢
      • 2010-12-06
      • 1970-01-01
      • 1970-01-01
      • 2016-04-14
      • 1970-01-01
      • 2011-11-09
      • 1970-01-01
      • 1970-01-01
      • 2015-10-28
      相关资源
      最近更新 更多