Moving XF to another dir

Beermonster

Active member
I'm thinking of installing Wordpress and using the WP and XF bridge, I've been told XF would be better in another directory and WP in root, I'm not too good with .htaccess does anyone know what I would put in to redirect the current URL from root to example /forum/

Or what would be the best way to redirect?

Also are they any config details I need to change in XF when moving it?
 
Thanks, I've tried making changes to my htaccess and it doesn't seem to do anything.

I've moved everything to a community directory, and changed the url in the admincp, this is my htaccess before changes, what and where do I need to change?

# 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 /

# This line may be needed to enable WebDAV editing with PHP as a CGI.
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]

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) - [NC,L]
RewriteRule (robots\.txt)$ robots.php [NC,L]
RewriteRule ^.*$ index.php [NC,L]


</IfModule>
 
Try uncommenting the rewrite base directive and place /community in place of the default /.
 
Thanks, I'm getting there, when someone visits from a search engine they get a 404 page, I can't get it to redirect from domain/threads/thread-title.html to domain/community/threads/thread-title.html
 
Thanks, it's helped a little, I now have 2 urls that will take you to the same content, one with community in it one without.

I don't want to have duplicate content listed, I don't know what to do with it now :(

This is my new .htaccess,

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.
RewriteRule ^community/(.*)?$ /$1 [R=301,L]
RewriteBase /community

# This line may be needed to enable WebDAV editing with PHP as a CGI.
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]
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>

I also have a similar one in the community dir
 
Thanks, it's helped a little, I now have 2 urls that will take you to the same content, one with community in it one without.

I don't want to have duplicate content listed, I don't know what to do with it now :(

This is my new .htaccess,

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.
RewriteRule ^community/(.*)?$ /$1 [R=301,L]
RewriteBase /community


# This line may be needed to enable WebDAV editing with PHP as a CGI.
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]
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>

I also have a similar one in the community dir


Your not using community any more are you? Then the bolded parts above need to be changed.
 
Top Bottom