XF 1.1 .htaccess taking over Mediawiki

Edit your XenForo .htaccess file and add the red code:

Rich (BB code):
	RewriteCond %{REQUEST_FILENAME} -f [OR]
	RewriteCond %{REQUEST_FILENAME} -l [OR]
	RewriteCond %{REQUEST_FILENAME} -d
	RewriteRule ^.*$ - [NC,L]
	RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|w/) - [NC,L]
	RewriteRule ^.*$ index.php [NC,L]

That should exclude your "w" directory.
 
Well wait. If the directory exists then it should already not be handled by XenForo. I have tested and confirmed this.

Right, the /w directory exists but is being rewritten to /wiki (which does not exist, it's a virtual directory) per the instructions in the link in the first post.

I added wiki/ to my htaccess like in your example above and it gives me this: http://minegasm.net/wiki/Main_Page
 
Here are the current contents of my .htaccess. Mediawiki's bit is at the bottom:
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

    #    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|wiki/) - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
</IfModule>

RewriteEngine On
RewriteRule ^/?wiki(/.*)?$ /w/index.php [PT,L,QSA]
RewriteRule ^/*$ /w/index.php [L,QSA]
 
You should probably exclude w/ and wiki/ to be safe. Though I don't think it's necessary.

Then you need to add the rewrite rules for the wiki to the htaccess file. Add those rules before XenForo's rules. I am feelin this:

Rich (BB 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

    RewriteRule ^/?wiki(/.*)?$ /w/index.php [PT,L,QSA]
    RewriteRule ^/*$ /w/index.php [L,QSA]

    #    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|wiki/|w/) - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
</IfModule>

I am not immediately sure what the purpose of the blue line is. I might be inclined to get rid of that.
 
You should probably exclude w/ and wiki/ to be safe. Though I don't think it's necessary.

Then you need to add the rewrite rules for the wiki to the htaccess file. Add those rules before XenForo's rules. I am feelin this:

<snip>

I am not immediately sure what the purpose of the blue line is. I might be inclined to get rid of that.

No dice, both with and without the blue line :( Also causes xF to grab the page again instead of the 404 I was getting with the one I posted above.

This one has me stumped, I greatly appreciate your help so far :)

If you're willing to take a crack at it I can PM you some FTP credentials.
 
Jake is a damn genius. Not three minutes after he got FTP info he fixed it... Been cracking my skull over this for five hours now. Here's what we ended up with, in case anyone has a problem like this in the future:
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

    RewriteRule ^/?wiki(/.*)?$ /w/index.php [PT,L,QSA]
    RewriteRule ^/*$ /w/index.php [L,QSA]

    #    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|wiki/|w/) - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
</IfModule>

Thanks again, Jake!
 
Code:
RewriteRule ^/*$ /w/index.php [L,QSA]

I didn't use that line to get it working. In fact that line interfered with XenForo.

I only added this line to the default XenForo htaccess file:

Code:
RewriteRule ^/?wiki(/.*)?$ /w/index.php [PT,L,QSA]
 
Top Bottom