Wordpress + Xenforo

Hesesses

Member
Hello,

I have Xenforo installed to my domain root (domain.com)
Now I have installed wordpress to /wordpress (domain.com/wordpress)

What is the best way to configure everything to have wordpress showing when user goes to my site (domain.com) and xenforo would be showing on domain.com/forum.

Also I'm wondering could it be possible somehow to have old forum links redirected to "new" links? (domain.com/threads/my-thread-name.100/ would redirect to domain.com/forum/threads/my-thread-name.100)
 
Also I'm wondering could it be possible somehow to have old forum links redirected to "new" links? (domain.com/threads/my-thread-name.100/ would redirect to domain.com/forum/threads/my-thread-name.100)

Put this in your .htaccess file in the web root:

Rich (BB code):
RewriteEngine On

RewriteRule ^(threads|forums|members)/(.*)$ /forum/$1/$2 [R=301,L]

You need to specify each XenForo route that you want to redirect to the new location. I included the important routes above. The rest don't matter as much.

And you need to make sure WordPress doesn't share any of these routes, otherwise you have a problem.
 
Wordpress has a dedicated option to easily do what you want. What you need is to create an index.php file with some specific code inside... I have to find back the tutorial.
Here it is (I'm not sure it's the one I used before): http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

Just to show you how my root index file looks now:
PHP:
<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */

/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define('WP_USE_THEMES', true);

/** Loads the WordPress Environment and Template */
require('./wordpress/wp-blog-header.php');
?>


I would love to see that for XenForo too ;)
 
Put this in your .htaccess file in the web root:

Rich (BB code):
RewriteEngine On
 
RewriteRule ^(threads|forums|members)/(.*)$ /forum/$1/$2 [R=301,L]

You need to specify each XenForo route that you want to redirect to the new location. I included the important routes above. The rest don't matter as much.

And you need to make sure WordPress doesn't share any of these routes, otherwise you have a problem.

Thanks for your reply.

I tried that but it is not working..

I have this in my .htaccess:

Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
 
RewriteRule ^(threads|forums|members)/(.*)$ /community/$1/$2 [R=301,L]
</IfModule>
 
Top Bottom