Redirect 301永久重定向,重定向错误?

Redirect 301永久重定向,重定向错误?,redirect,http-status-code-301,Redirect,Http Status Code 301,我正在尝试重定向尝试访问的流量: cat.rs.allgames.com/cloud/11/services/titles/game5/console/file.json 致: cat.cloud.allgames.com/titles/game5/console/file.json 在.htaccess文件中使用301永久重定向,但它总是将我发送到: cat.cloud.allgames.comcloud/titles/game5/console/cloud/11/services/title

我正在尝试重定向尝试访问的流量:
cat.rs.allgames.com/cloud/11/services/titles/game5/console/file.json

致:
cat.cloud.allgames.com/titles/game5/console/file.json

在.htaccess文件中使用301永久重定向,但它总是将我发送到:
cat.cloud.allgames.comcloud/titles/game5/console/cloud/11/services/titles/game5/console/file.json

这几乎是不正确的。我做错了什么

My.htaccess位于:
cat.rs.allgames.com/cloud/11/services/titles/game5/console/file.json

看起来是这样的:

重定向301/http://cat.cloud.allgames.com

重写模块应该执行您想要的操作!您需要确保已启用“重写”模块(对于ubuntu:
sudoa2enmod rewrite
),然后将其添加到您的
.htaccess
文件中

RewriteEngine On
RewriteRule ^/cloud/11/services/titles/(.*)$ http://cat.cloud.allgames.com/titles/$1 [R=301]
这里,
^/cloud/11/services/titles/(.*)$
捕获URL标题部分之后的任何内容。然后,第二部分末尾的
$1
将我们捕获的内容附加到新URL的末尾。最后,您可以使用
[R=301]
标志将其指定为对另一台服务器的外部301重写


希望这对你有用

建议您切换到RedirectMatch,因为Redirect仅用于路径的精确匹配。我觉得我应该使用ProxyPass进行此操作。请原谅我的经验不足,但我不确定在哪里使用ProxyPass命令。它在httpd.conf文件中吗?我不知道如何使用ProxyPass