简体   繁体   English

从旧域重定向循环到新子域

[英]Redirect loop from old domain to new subdomain

I have an issue with .htaccess rewrite ruleset. 我对.htaccess重写规则集有疑问。 www.OldDomain.com with Joomla template is being retired and new website is a Wordpress based site having address at http://newdomain.com/subfolder . 具有Joomla模板的www.OldDomain.com即将退休,新网站是基于Wordpress的网站,其地址为http://newdomain.com/subfolder

For some reason I get the following message: "This webpage has a redirect loop", but whatever I try it doesn't work. 出于某种原因,我收到以下消息:“此网页具有重定向循环”,但是无论如何尝试都无法正常工作。 The new Wordpress site has url-friendly links generated by wordpress. 新的Wordpress网站具有wordpress生成的URL友好链接。 I tried to upload a default wordpress .htaccess but it doesn't work either. 我尝试上传默认的wordpress .htaccess文件,但它也不起作用。

Can anyone point me in right direction how to solve this issue? 谁能指出正确的方向,如何解决这个问题? Thank you in advance. 先感谢您。

The old site was on a different server with the same domain name as the new one. 旧站点位于与新站点具有相同域名的另一台服务器上。

Current .htaccess file on a domains' new server is as follows: 域的新服务器上的当前.htaccess文件如下:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^newdomain\.com$
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]
RewriteRule ^$ beta/ [L]

You can use the following : 您可以使用以下内容:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !newdomain.com$ [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/beta/$1 [L,R=301]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM