XF 2.2 How to link from Root to your folder

Adam Bloch

Member
This is as simple as it sounds. For years we have had a little HTML file that redirects everyone from the root to the folder the xenforo installation is in. Surly we should be doing this in the .htaccess and if so how ??

:)
 

Muddy Boots

Active member
Something like this in the root .htaccess

(not tested)

Code:
# Permanent URL redirect
Redirect 301 / /xenforoinstallation

Repack xenforoinstallation with your foldername
 

Adam Bloch

Member
would this work better? The sub folder is called xf. Might be better for SEO?


RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^xf/(.*)$ /$1 [L,R=301]
RewriteCond %{REQUEST_URI} !^/xf [NC]
RewriteRule ^(.*)$ /xf/$1 [L]
 

djbaxter

in memoriam 1947-2022
Is there anything at the root?

If not, why not install XF there?
I was just going to post the same thing.
  1. Transfer all XF files and folders to the root.
  2. Get rid of the HTML redirect and any .htaccess redirects.
  3. Change the canonical settings in Basic Options.
 

Mr Lucky

Well-known member
I was just going to post the same thing.
  1. Transfer all XF files and folders to the root.
  2. Get rid of the HTML redirect and any .htaccess redirects.
  3. Change the canonical settings in Basic Options.
Good idea IMO, but you'd probably be best off with a redirect to the root from the old folder installation.
 
Top