Regex htaccess在Yii中重定向

Regex htaccess在Yii中重定向,regex,.htaccess,redirect,yii,http-status-code-404,Regex,.htaccess,Redirect,Yii,Http Status Code 404,我正在使用Yii框架,但重定向有问题。我想从谷歌搜索中显示的旧url重定向到我的主页。但是重定向没有生效,我得到了404错误。我是否可以指定.htm扩展名不会出现404错误,而是重定向到主页 以下是我的htaccess文件中的重定向: Redirect /file\s_mostra_milano/mostra_marionette-milano.htm http://marionettecolla.org/ 旧的url如下所示: http://www.marionettecolla.org/f

我正在使用Yii框架,但重定向有问题。我想从谷歌搜索中显示的旧url重定向到我的主页。但是重定向没有生效,我得到了404错误。我是否可以指定.htm扩展名不会出现404错误,而是重定向到主页

以下是我的htaccess文件中的重定向:

Redirect /file\s_mostra_milano/mostra_marionette-milano.htm http://marionettecolla.org/
旧的url如下所示:

http://www.marionettecolla.org/file%20_mostra_milano/mostra_marionette-milano.htm
我想将其重定向到主页:

http://www.marionettecolla.org/
试试这个:

Redirect /file%20_mostra_milano/mostra_marionette-milano.htm http://www.marionettecolla.org/
如果要使用正则表达式,请尝试以下操作:

RedirectMatch /file[ ]_mostra_milano/mostra_marionette-milano\.htm$ http://www.marionettecolla.org/
最后但并非最不重要的一点是,这里提供了一个用于创建或更新.htaccess的联机服务。

尝试以下操作:

Redirect /file%20_mostra_milano/mostra_marionette-milano.htm http://www.marionettecolla.org/
如果要使用正则表达式,请尝试以下操作:

RedirectMatch /file[ ]_mostra_milano/mostra_marionette-milano\.htm$ http://www.marionettecolla.org/

最后但并非最不重要的一点是,这里有一个用于创建或更新你的.htaccess的在线链接。

你能在你的问题中添加谷歌搜索中使用的旧url吗?你能在你的问题中添加谷歌搜索中使用的旧url吗?