的.htaccess有问题RedirectMatch [英] .htaccess having issue with RedirectMatch

查看:131
本文介绍了的.htaccess有问题RedirectMatch的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,我需要重定向的URL在。

I have a site where I need to redirect from one url to another.

当前的URL: www.somesite.com/people/johndoe/?id=10

所需的URL: www.somesite.com/people/?id=10

我想这在我的.htaccess文件,但无济于事:

I am trying this in my .htaccess file but to no avail:

RedirectMatch ^ /人/(.*)$ /人/?ID = $ 1

这将返回:

www.somesite.com/people/?id=johndoe

我已经看过了这个网站和其他地方的许多类似的问题,但无法找到一个解决方案,工程。在此先感谢

I have looked up many similar questions on this site and elsewhere, but cannot find a solution that works. Thanks in advance

推荐答案

您正则表达式是不正确的。

Your regex is not correct.

使用这样的:

RedirectMatch ^/(people)/.+$ /$1

这篇关于的.htaccess有问题RedirectMatch的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆