Wordpress-如何使用帖子或页面名称作为子域?
是否有一种方法可以将帖子名用作子域 例如,我需要更改: example.com/test-page/->test-page.example.comWordpress-如何使用帖子或页面名称作为子域?,wordpress,Wordpress,是否有一种方法可以将帖子名用作子域 例如,我需要更改: example.com/test-page/->test-page.example.com example.com/mypost/->mypost.example.com只是一个建议,您可以尝试使用带有.htaccess(Apache)或.conf(nginx)的重定向将URL(自动URL转发)重定向到子域 在nginx中: location = / { # don't redirect http://example.com/ }
example.com/mypost/->mypost.example.com只是一个建议,您可以尝试使用带有.htaccess(Apache)或.conf(nginx)的重定向将URL(自动URL转发)重定向到子域 在nginx中:
location = / {
# don't redirect http://example.com/
}
location / {
# redirect everything else
rewrite ^\/([^\/]*).*$ http://$1.example.com/ redirect;
}
将重定向
替换为永久性
,具体取决于您想要的是临时(HTTP 302)重定向还是永久(HTTP 301)重定向
空的
location=/
块是必需的,这样您就不会重定向到。我个人没有使用过这个插件,但它可能会为您的目的工作:不,这个插件不工作!