【问题标题】:mod_rewrite other rule if more parametersmod_rewrite 其他规则如果更多参数
【发布时间】:2012-08-10 21:05:14
【问题描述】:

我实际上使用这个 mod_rewrite 为我的系统做 SEO 友好:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ $1/ [L,R=301] 
RewriteRule ^(.*)/$ /?c=$1&l=deu

我不知道它为什么会起作用,但经过数小时的尝试和错误,这对我来说是解决方案,现在我想扩展它。

我想要类似的东西

"if /eng/ is on the end of the url, redirect request to ?c=$1&l=eng"

在所有其他情况下,它都应该使用上面发布的规则。

有人可以帮帮我吗? (对不起我的英语不好)

【问题讨论】:

  • 这个问题似乎离题了,因为它缺乏对 mod_rewrite 的基本了解

标签: mod-rewrite


【解决方案1】:

尝试在 301 规则之后添加此内容

RewriteRule ^(.*)/eng/$ /?c=$1&l=eng [L]

【讨论】:

  • 非常感谢!现在完美运行
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-12-01
  • 1970-01-01
  • 1970-01-01
  • 2010-09-22
  • 2023-03-08
  • 1970-01-01
相关资源
最近更新 更多