【问题标题】:Htaccess redirection with directory to querystring带有目录的 Htaccess 重定向到查询字符串
【发布时间】:2013-05-14 09:55:43
【问题描述】:

以下是我浏览时使用 htaccess 进行的重定向 我的 example.net/video/1 ,然后将我重定向到 example.net/abc/redirect.php

Options +FollowSymLinks

RewriteEngine on
RewriteCond %{Request_URI} /picture?$
RewriteRule ^ http://example.net/abc/redirect.php [L,R=301]

呃,如果我需要类似...当我通过此链接浏览时怎么办 http://example.net/picture/1http://example.net/picture/2

它会将我重定向到带有查询字符串的链接,例如

http://example.net/abc/redirect.php?picture=1

http://example.net/abc/redirect.php?picture=2

谢谢! :)

【问题讨论】:

    标签: .htaccess redirect hyperlink directory query-string


    【解决方案1】:
    RewriteRule ^picture/([\d]+) /redirect.php?picture=$1 [L,R=301]
    

    【讨论】:

      猜你喜欢
      • 2015-11-26
      • 1970-01-01
      • 2015-07-30
      • 2016-01-18
      • 2012-08-26
      • 2014-07-08
      • 1970-01-01
      • 2015-05-27
      • 2020-12-14
      相关资源
      最近更新 更多