【问题标题】:htaccess redirect urls with parameters to specific directoryhtaccess 将带有参数的 url 重定向到特定目录
【发布时间】:2015-06-06 05:48:58
【问题描述】:

我想重定向特定的网址

http://www.domain.com/com/page.asp?id=99
to
https://www.domain.com/de/directory/

以及来自

的所有网址
http://www.domain.com/com/page.asp
to
https://www.domain.com/de/

我尝试了一些重定向,但我无法正确完成。 请帮帮我!

RewriteCond %{query_string} id=5
RewriteRule (.*) https://www.domain.com/de/directory/? [R=301,L]

this works, but the biggest problem is all urls in the cms https://www.domain.com/cms are redirected too if they contain an id

【问题讨论】:

  • 查看编辑后的帖子。谢谢!
  • /com/ 之前的page.asp 是真实目录吗?

标签: apache .htaccess redirect web


【解决方案1】:

试试:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^id=99$
RewriteRule ^page\.asp$ /de/directory/ [L,R]
RewriteRule ^page\.asp$ /de/ [L,R]

【讨论】:

    猜你喜欢
    • 2013-09-11
    • 1970-01-01
    • 2022-07-01
    • 2014-03-06
    • 1970-01-01
    • 1970-01-01
    • 2020-08-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多