首页 > 解决方案 > 在wordpress中将页面Url重写为子域

问题描述

有没有办法将帖子用作子域。

例如我需要更改:example.com/test-page/ -> test-page.example.com example.com/mypost/ -> mypost.example.com

我在 Nginx 中使用此规则,即重写 URL 但页面或帖子但不加载显示主页的实际内容。

location / {
# redirect everything else
rewrite ^\/([^\/]*).*$ http://$1.example.com/ redirect;

}

//真实网址

https://about-us.insuranceworld.tech/ https://insuranceworld.tech/

标签: mod-rewrite

解决方案


推荐阅读