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

XF 1.1 Domain and htaccess problem

Discussion in 'Troubleshooting and Problems' started by Roberto Bilić, Mar 30, 2013.

  1. Roberto Bilić

    Roberto Bilić Active Member

    I have .htaccess with force redirect non www to www. Today I change TLD (domain is old, only TLD) and try force redurect visitors and spiders from www.domain.in to www.domain.com but do something wrong and now cannot access to board. I forced to www.www.domain.com/forum. (Browser issue)

    Old domain: hedonist385.in
    New domain: hedonist385.com
    XenForo path: /home/user/public_html/forum

    Here is htaccess. I want force nonwww to www and from domain.in to domain.com and want inform Google to new domain (to prevent double posts).

    Code:
    #    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
    #</IfModule>
     
    ErrorDocument 401 default
    ErrorDocument 403 default
    ErrorDocument 404 default
    ErrorDocument 500 default
     
    <IfModule mod_rewrite.c>
        RewriteEngine On
     
            RewriteCond %{HTTP_HOST} ^hedonist385\.in$
        RewriteRule ^(.*)$ http://www.hedonist385.in/forum/$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]
    </IfModule>
    EDIT

    I think problem resolved. Forget add [OR] in second line. Now is htaccess (It's OK now?) How Google see that redirect?

    Code:
    #    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
    #</IfModule>
     
    ErrorDocument 401 default
    ErrorDocument 403 default
    ErrorDocument 404 default
    ErrorDocument 500 default
     
    <IfModule mod_rewrite.c>
        RewriteEngine On
     
            RewriteCond %{HTTP_HOST} ^hedonist385.in$ [OR]
            RewriteCond %{HTTP_HOST} ^www.hedonist385.in$ [OR]
            RewriteCond %{HTTP_HOST} ^hedonist385\.com$
        RewriteRule ^(.*)$ http://www.hedonist385.com/forum/$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]
    </IfModule>
     
    Jake Bunce likes this.

Share This Page