mod-rewrite - 在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/
解决方案
推荐阅读
- python - 从另一个 .py 脚本执行 .py 脚本时未定义 Python NameError 'xxx'
- python - Sonic Pi 不会从远程 Python 脚本播放声音
- elasticsearch - 审计 elasticsearch 操作
- javascript - 验证 const String 加上任何变量文本
- twilio - Twilio Flex 的 CRMContainer uriCallback 不允许 http 站点
- git - 将 Visual Studio 2019 连接到 github
- flutter - Flutter:删除当前路由下方的所有路由[屏幕]
- excel - VBA:UDF对一系列单元格求和,直到第n列
- r - 如何在 vars 包中手动设置 IRF 的冲击幅度
- google-apis-explorer - 谷歌知识图搜索 API 奇怪的结果