阿帕奇重定向 [英] Apache redirect

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

问题描述

我想在 Apache 中使用 RedirectMatch 重定向 URL,例如,

I would like to redirect a URL using RedirectMatch within Apache eg,

/test/one/??重定向到/test/two/??

/test/one/?? redirect to /test/two/??

在哪里??表示后面的任何字符串

where the ?? represents any string that follows

我在下面使用的重定向进行了直接重定向,但在...之后不匹配任何字符串RedirectMatch 永久 ^/test/one?$/test/two/

The redirect i'm using below does a straight redirect but doesnt match any string after... RedirectMatch Permanent ^/test/one?$ /test/two/

非常感谢

推荐答案

RewriteEngine ON
RewriteBase /
RewriteRule ^/test/one/(.+)$ /test/two/$1

如果这不起作用,请将 ^/test/one 更改为 ^test/one

if that does not work, change ^/test/one into ^test/one

确保 mod_rewrite 已启用

make sure mod_rewrite is enabled

这篇关于阿帕奇重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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