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

XF 1.1 .htaccess conflicts between XF and WP

Discussion in 'Troubleshooting and Problems' started by Ryan McAdams, Oct 4, 2012.

  1. Ryan McAdams

    Ryan McAdams Active Member

    I recently just moved to a new server... for some reason wordpress and xenforo are not playing nicely which baffles me, it's been working for a long time.

    I've got the main site up at www.domain.com and the forums at www.domain.com/forums

    Each software package (wordpress and xf) has their own .htaccess.

    Wordpress .htaccess is:

    Code:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    XF .htaccess is:

    Code:
    <IfModule mod_rewrite.c>
            RewriteEngine On
     
            RewriteCond %{REQUEST_FILENAME} -f [OR]
            RewriteCond %{REQUEST_FILENAME} -l [OR]
            RewriteCond %{REQUEST_FILENAME} -d
            RewriteRule ^.*$ - [NC,L]
            RewriteRule ^(data|js|styles|install) - [NC,L]
            RewriteRule ^.*$ index.php [NC,L]
    </IfModule>
    
    The issue:

    When I enable the .htaccess for wordpress, the main site works great.... but the xenforo links 404... if I disable the wordpress .htaccess the forums work fine.

    This exact config worked on my old server but I'm running the exact same software versions, AllowOveride and mod_rewrite are both enabled.

    Any thoughts?
     
  2. Digital Doctor

    Digital Doctor Well-Known Member

    u Might want to ask at Xenscripts.com
     
  3. Ryan McAdams

    Ryan McAdams Active Member

    Why would I ask there? This has nothing to do with Xenscripts or it's products, this is an .htaccess conflict.
     
  4. Digital Doctor

    Digital Doctor Well-Known Member

    That's where the XF + WP crowd is.
    Lots of brain power there.
    Ideally someone will help you here :)
     
  5. Insy

    Insy Well-Known Member

  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Try adding this to your WP .htaccess file:

    Code:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    
    # IGNORE FORUMS DIRECTORY
    RewriteRule ^forums - [L]
    
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
     
  7. Ryan McAdams

    Ryan McAdams Active Member

    That didnt work either Jake... this really has me confused.
     
  8. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Then try adding this to your XF .htaccess file:

    Code:
    <IfModule mod_rewrite.c>
            RewriteEngine On
     
            RewriteBase /forums
    
            RewriteCond %{REQUEST_FILENAME} -f [OR]
            RewriteCond %{REQUEST_FILENAME} -l [OR]
            RewriteCond %{REQUEST_FILENAME} -d
            RewriteRule ^.*$ - [NC,L]
            RewriteRule ^(data|js|styles|install) - [NC,L]
            RewriteRule ^.*$ index.php [NC,L]
    </IfModule>
    
     
    Andrej and Adam Howard like this.

Share This Page