简体   繁体   English

使用htaccess将域的所有页面重定向到wordpress网站

[英]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.

相关问题 使用.htaccess重定向WordPress中的所有标签页 - Redirect all tag pages in WordPress using .htaccess htaccess 将一个域上的所有子文件夹/页面重定向到新域 (WordPress) 上的匹配子文件夹 - htaccess redirect all subfolders/pages on one domain to matching subfolder on new domain (WordPress) 如何使用带有子域的htaccess和Wordpress将所有页面重定向到“ https”? - How redirect all pages to 'https' using htaccess and Wordpress with a subdomain? 将所有网站页面重定向到 wordpress 仪表板 - Redirect all website pages to wordpress dashboard 使用 htaccess 将 wordpress 网站重定向到目录 - Redirect wordpress website to a directory using htaccess 如何使用.htaccess进行此工作-将主域重定向到子域并将所有其他页面重定向到新域 - How do I make this work using .htaccess - redirect main domain to subdomain & redirect all other pages to new domain 使用 htaccess 将所有页面重定向到单个页面? - Redirect all the pages to the single page using htaccess? 将所有子域指向Wordpress网站(htaccess)上的根域 - Point all subdomains to root domain on wordpress website (htaccess) htaccess将域名重定向到wordpress页面? - htaccess redirect domain to wordpress page? 如何将所有wordpress帖子和页面重定向到新域? - How to redirect all wordpress posts and pages to a new domain.?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM