admin管理员组文章数量:1332345
I work as a sysadmin at a large academic department. We have an apache httpd, with a WP subdirectory multisite installation, fronted by an apache reverse proxy. In this setup we want to allow our users to serve WP content under the main domain name (external
, say) with their own name attached (user1
):
The vhost config looks like
# ...
RequestHeader set X-Forwarded-Proto "https"
ProxyPass / /
ProxyPassReverse / /
ProxyPreserveHost On
# ...
This allows us to assign users their own wp sites, as user1
, with siteurl and host both set to , and they can edit and publish.
And we want to add sites for whole research projects, with their own domain names, that should be addressed as a bare domain name: . I've set the vhost config like this:
# ...
RequestHeader set X-Forwarded-Proto "https"
ProxyPass /
ProxyPassReverse /
ProxyPreserveHost On
# ...
With siteurl and host both set to , this gives a 404 error on the root, with an 'Oops!' for the home page, and goes into 301 loops on permalinks.
With siteurl and host both set to , there is a redirect to the main site root when trying
https://project1/
, but the permalinks work ...
The rewrite rules look like
RewriteEngine On
RewriteBase /wpsites/
# if req NOT lastly from reverse proxy, redirect thru it
# -- 'cause direct access doesn't work
RewriteCond %{REMOTE_ADDR} !^111\.111\.111\.111$
RewriteRule ^(.*)$ /$1 [R=301,L]
RewriteRule ^index.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
EDIT: additional configuration that may shed some light:
- the WP site is in a subdirectory of the httpd docroot (it's implicitly mentioned above)
- the domain is set to
project1
and the path to/
in thewp_blogs
table
Is this possible, at all? How, in that case? Changes to the .htaccess file? To the vhost config? To the siteurl and host options? Move the site to the docroot? Change the domain/path values in the wp_blogs
table?
本文标签: directorySubdirectory multisite installation with several domain names
版权声明:本文标题:directory - Subdirectory multisite installation with several domain names? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742327926a2454098.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论