【发布时间】:2016-07-31 19:05:47
【问题描述】:
我的一些网站网址以 10 位数字和一个字母“M”结尾。我想把它重定向到我的主页。我正在使用 apache 网络服务器。
网址 www.example.com/my-page/M1234567890 应重定向到 www.example.com
我试图在 .htaccess 中使用 redirectmatch 来实现这一点,但我在 .htaccess 中给出的模式不起作用。我尝试通过多种方式实现这一目标,但没有奏效。
请看我下面的代码。
Redirectmatch 301 ^([C])(d{14})/?$ /
【问题讨论】:
-
只是
my-page/M1234567890或anything-there/M1234567890? -
嗨@nicael,什么都有/M1234567890。