[英]Redirect all pages of a domain using htaccess to a wordpress website
I am using this: 我正在使用这个:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]RewriteCond %{HTTP_HOST} ^(www\.)?domain\.info$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
</IfModule>
This is a wordpress website (I'm not sure it does change anything), 这是一个wordpress网站(我不确定它是否会更改任何内容),
At the moment domain.info goes to domain.com as expected, But domain.info/page-1/ is displaying instead of being redirected to domain.com. 目前,domain.info可以按预期的方式转到domain.com,但是显示的是domain.info/page-1/,而不是重定向到domain.com。
Thanks for your help! 谢谢你的帮助!
Try this rule... 试试这个规则...
RewriteCond %{HTTP_HOST} !^domain.\.info$ [NC]
RewriteRule ^(.*)$ http://domain.com [R=301,L]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.