• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Multiple domains accessing same forum ... leads to ...

LPH

Well-known member
#1
Hi,

I have multisite WP enabled, with different domains mapped. Now, all of the domains need to use /community to login because the XenScripts bridge is used. However, this is leading to duplicate content being seen by search engines.

Will I block the duplicate content issues if I put a robots.txt file with the following disallow?

Code:
User-agent:*
Disallow:
Disallow: /http://www.tabletquestions.com/community/
Disallow: /http://www.amdviews.com/community/
Disallow: /http://www.insanepolitics.com/community/
Etc. ... for all the domains ...

Is there a better way? The user must be able to login using XenScripts bridge but the content must be seen as unique under one domain ... in other words .. I cannot do a redirect to a particular domain or else people cannot log into the WordPress.
 

Jake Bunce

XenForo moderator
Staff member
#2
Try this in a .htaccess file in your /community directory:

Code:
RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\.maindomain\.com$
RewriteCond %{REQUEST_URI} !login/login
RewriteRule ^(.*)$ http://www.maindomain.com/community/$1 [R=301,L]
Assuming it's the "login/login" action that WP needs...

This will redirect all /community locations to your main domain except for the login/login action.
 

LPH

Well-known member
#4
Close but still flips to the other domain.

Code:
RewriteCond %{HTTP_HOST} !^www\.tuxreportsdebates\.com$
RewriteCond %{REQUEST_URI} !login/login
RewriteRule ^(.*)$ http://www.tuxreportsdebates.com/community/$1 [R=301,L]
maybe the second line needs to have the /community in some how?
 

Jake Bunce

XenForo moderator
Staff member
#5
Close but still flips to the other domain.

Code:
RewriteCond %{HTTP_HOST} !^www\.tuxreportsdebates\.com$
RewriteCond %{REQUEST_URI} !login/login
RewriteRule ^(.*)$ http://www.tuxreportsdebates.com/community/$1 [R=301,L]
maybe the second line needs to have the /community in some how?
Which URL flips that shouldn't flip?

/community is not needed in the second line.
 

LPH

Well-known member
#6

Jake Bunce

XenForo moderator
Staff member
#7
Then you need to specify the login form as well:

Code:
RewriteCond %{HTTP_HOST} !^www\.tuxreportsdebates\.com$
RewriteCond %{REQUEST_URI} !(/login/login|/login)
RewriteRule ^(.*)$ http://www.tuxreportsdebates.com/community/$1 [R=301,L]
 

LPH

Well-known member
#9
Thank you for trying Jake but something must be squirmy with the way I have this mapped and laid out. That code didn't work either.

I also tried to add in the logout portion because that would have to be blocked too. Unfortunately, it's still rolling over.

I was placing this in an .htaccess in /community. It is removed right now because it flips everything to tuxreportsdebates and I cannot login or logout.
 

Jake Bunce

XenForo moderator
Staff member
#10
You would have to add each location:

Code:
RewriteCond %{HTTP_HOST} !^www\.tuxreportsdebates\.com$
RewriteCond %{REQUEST_URI} !(/login/login|/login|/logout)
RewriteRule ^(.*)$ http://www.tuxreportsdebates.com/community/$1 [R=301,L]
It works in my testing. I can take a look if you want.