Wordpress multisite, domain mapping www issue

2019-08-17 16:00发布

问题:

Hey there, I have installed wordpress multisite and domain mapping plugin.

The problem is with the www...if i setup the multisite without www and i access the site without www everything works fine But if i access it without www, it reddirects to the main site. Any ideea why? Ty

回答1:

Maybe this could help you

http://wordpress.org/support/topic/plugin-wordpress-mu-domain-mapping-add-an-www-prefix?replies=7

Edit: Actually, I found a non-coding easier solution. In the 'Super Admins -> Domains' page, add both the www. and non-www. versions of the domain, but select the box of 'primary' for if you want to mainly use for www. or non-www. and both will be assigned to the blog.



回答2:

This is the setup that has worked for me:

  • Go to /wp-admin/network -> Settings -> Domain mapping:
    • Set your primary site domain (without www) on Server CNAME domain, leave IP empty
    • Uncheck remote login
    • check permanent redirect
    • check user domain mapping page
    • uncheck Redirect administration pages to site's original domain
    • uncheck Disable primary domain check
  • Go to /wp-admin/network/ -> setting -> Domains: Map each site to its domain (without www)

For each site that you want to default to www (except the primary)

  • Go /wp-admin/ -> Tools -> domain mapping
    • In Add new domain insert the site's domain (with www)
    • Check Primary domain for this blog

(Please note that you have to make sure beforehand that your domain is working with and without www)



标签: wordpress