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

.htaccess on multisite WP

Discussion in 'Server Configuration and Hosting' started by LPH, Apr 21, 2012.

  1. LPH

    LPH Well-Known Member


    I think there is a big issue with my installation. I have WP 3.3.1 installed, multisite enabled, and XF in /community directory.

    I only want the forums available using www.tuxreportsdebates.com/community

    However, someone can use www.tuxreportsnetwork.com/community or any other domain on the multisite install to get to the forums.

    What is the best way to get it so that only www.tuxreportsdebates.com/community is seen by the search engines and more important - by the visitor ?!

    Update: I should be more proactive and explain that a few .htaccess attempts do not seem to be working.

    RewriteCond %{HTTP_HOST} !=www.tuxreportsdebates.com
    RewriteRule ^community/?(.*)$  http://www.tuxreportsdebates.com/community/ [R=301,L]
  2. LPH

    LPH Well-Known Member

    Well - the host tried this one and it didn't work either

    RewriteCond %{HTTP_HOST} !^www.tuxreportsdebates.com
    RewriteRule ^community(.*) http://www.tuxreportsdebates.com/community$1 [R=301,NC]
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Add the red code to the .htaccess file in the community directory:

    #	Mod_security can interfere with uploading of content such as attachments. If you
    #	cannot attach files, remove the "#" from the lines below.
    #<IfModule mod_security.c>
    #	SecFilterEngine Off
    #	SecFilterScanPOST Off
    ErrorDocument 401 default
    ErrorDocument 403 default
    ErrorDocument 404 default
    ErrorDocument 500 default
    <IfModule mod_rewrite.c>
    	RewriteEngine On
    	RewriteCond %{HTTP_HOST} !^www\.tuxreportsdebates\.com$
    	RewriteRule ^(.*)$ http://www.tuxreportsdebates.com/community/$1 [R=301,L]
    	#	If you are having problems with the rewrite rules, remove the "#" from the
    	#	line that begins "RewriteBase" below. You will also have to change the path
    	#	of the rewrite to reflect the path to your XenForo installation.
    	#RewriteBase /xenforo
    	#	This line may be needed to enable WebDAV editing with PHP as a CGI.
    	#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    	RewriteCond %{REQUEST_FILENAME} -f [OR]
    	RewriteCond %{REQUEST_FILENAME} -l [OR]
    	RewriteCond %{REQUEST_FILENAME} -d
    	RewriteRule ^.*$ - [NC,L]
    	RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
    	RewriteRule ^.*$ index.php [NC,L]
    That should work.
  4. LPH

    LPH Well-Known Member

    Thank you. Yes. It turns out the rewrite rules had to go into /community. Unfortunately, if this rewrite is done then I cannot use the XenScript bridge. After fussing several days, it looks like I'll keep looking for better navigation.

Share This Page