Apache的重定向 [英] Apache redirect

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

问题描述

我想重定向内使用Apache的一个RedirectMatch URL例如,

/测试/一个/?重定向到/测试/二/ ??

在哪里?再presents后面任何字符串

我使用下面的重定向不直重定向,但犯规之后匹配的字符串...
RedirectMatch永久^ /测试/吗?$ /测试/二/

很多

感谢
解决方案

  RewriteEngine叙述ON
的RewriteBase /
重写规则^ /测试/个/(.+)$ /测试/二/ $ 1

如果不工作,改变^ /测试/一进^测试/个

确认mod_rewrite的启用

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

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

where the ?? represents any string that follows

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

Thanks alot

解决方案

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

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

make sure mod_rewrite is enabled

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

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