internetfett
Member
Posted 1 year ago #
I use the domain mapping plugin on a subdomain multisite install. Most of our sites are on subdomains, but there are a few that need to stay as subdirectories to use an existing popular URL.
The problem is that the root blog and any subdirectory sites redirect to the root blog if the www prefix is left out. For example, if you go to http://mysite.com/?page=15 or http://mysite.com/subdirectory/?page=15, you are redirected to http://www.mysite.com/
I feel like a domain mapping entry for http://mysite.com/ is required, however there is no option to add additional URLs for the root blog. I've tried to add the setting manually to the database, but that generates a page not found for both the root blog and any subdirectories with or without the www.
Anybody have a solution?
however there is no option to add additional URLs for the root blog.
Sure there is.
Go back to the domain mapping menu, map the www version and UNcheck the "primary url" box.
internetfett
Member
Posted 1 year ago #
Anything that I enter with Site ID 1 simply does not show up after I click save. Any other site ID works fine.
I've added the entries manually to the database and, although it seems to be mapping properly, the browser shows the root blog's theme and a Not Found error.
internetfett
Member
Posted 1 year ago #
To clarify: attemping to access mysite.com/subdirectory/?p=1 sends me to http://www.mysite.com/?p=1, which actually is being found- the hello world post.
You cannot map the main site. (which always has an ID of 1)
If you want to use the www with the main domain of the install, then it's not a domain mapping issue. At all.
blankpoint
Member
Posted 1 year ago #
Andrea, just to clarify -- is the following setup possible?
1. MAIN SITE --> http://www.maindomain.com
2. maindomain.com and maindomain.com/whatever will redirect to http://www.maindomain.com and http://www.maindomain.com/whatever, respectively
3. secondary.maindomain.com for multi-site blogs
4. alternate domains for selected multi-site blogs, with www --> http://www.anotherdomain.com (anotherdomain.com would redirect to http://www.anotherdomain.com)
Hope these questions are clear. Thanks for your work.
For 4, you'd have to add BOTH http://www.anotherdomain.com and anotherdomain.com (and pick one to be the 'primary')
2 is, I thought, default behavior if you picked http://www.domain.com as your set up.
internetfett
Member
Posted 1 year ago #
Okay, thank you. There must be an issue with my Rewrite rules.
internetfett
Member
Posted 1 year ago #
I added the following to the start of my .htaccess file to carry anything after the domain to the www. version.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mysite.com$
RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]