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

Moving XenForo installation to another directory, some questions.

Discussion in 'XenForo Questions and Support' started by Divvens, Mar 31, 2012.

  1. Divvens

    Divvens Well-Known Member

    I know how to change it to another directory but I wanted get some information on it.

    We are building our own site on the main domain and want to move the forum into a /community directory. But I don't want to break all our existing links, and I have my .httaccess that removes the www. which is

    RewriteCond %{HTTP_HOST} www.orojackson.com$
    RewriteRule ^(.*)$ http://orojackson.com/$1 [R=301,L]

    If I add that to the httaccess on the main directory it should work for the forum as well right? (removing the www.).

    So how can I avoid breaking the older links temporarily at least until google index's the new URL's and until we internally fix all the url's linking to other important internal pages.

    Note: We will be using a splashscreen "Coming Soon" on http://orojackson.com, so we don't want that to redirect to http://orojackson/community apart from that all the old links I want it to redirect to the new ones for some time. Is that possible?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    This will redirect all URLs except for the root URL:

    Code:
    RewriteEngine On
    RewriteRule ^$ - [S=1,L]
    RewriteRule ^(.*)$ /community/$1 [R=301,L]
    
     
    CapnLuffy likes this.
  3. Divvens

    Divvens Well-Known Member

    Thanks Jake,

    But we have cancelled the plan to move our forum to another directory, taking many things into consideration.

    What we want to do now is use a different index for the forum, but keep the forum in the same directory. Something like what XenPorta does with the index controller, moves forums to /forums without actually changing the directory. Is this possible to do if we want a different index page at orojackson.com (root url)?

    If yes what would we need to do, I'm sorry to be troubling you :p
     
  4. Divvens

    Divvens Well-Known Member

    Could anyone guide me on how to achieve this, is it a httaccess re-write rule or do I need to meddle with something XF related :p
     
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You can define a different page to be the directory index:

    http://www.javascriptkit.com/howto/htaccess6.shtml

    As you noted, XenPorta has an option to swap itself into the index route. You can do the same thing with any addon by using the Route Changer:

    http://xenforo.com/community/resources/route-changer.447/

    In fact, a XenPorta example is given at the above link which shows how you can remap the index route using that addon. But note that the index route can only remain empty for "simple" URLs. For example, if you try to assign the "threads" route to "index" then you will get URLs like this:

    http://xenforo.com/community/index/29840/

    This is because "threads" URLs have extra parameters in the URL so the "index" part cannot be removed. It works for the "portal" route in XenPorta because that is a "simple" route with no extra parameters in the URL, so the route can be empty.

    ...if that makes sense.
     
    CapnLuffy likes this.
  6. Divvens

    Divvens Well-Known Member

    Thanks a lot Jake :D
     

Share This Page