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

XF 1.2 From folder with subdomain to root

Discussion in 'Troubleshooting and Problems' started by Sheratan, Jul 27, 2013.

  1. Sheratan

    Sheratan Well-Known Member

    So I had XF installed in /forum folder, with subdomain forum.domain.com

    Is there any .htaccess redirect rules if I wanted to move XF to root? So any forum.domain.com/thread and /posts and the other will be redirected to domain.com/forum (root, not folder)

    Thank you.
     
  2. MattW

    MattW Well-Known Member

    So what will be the new URL for the site once you have moved it?

    domain.com/forum/ (like XF is xenforo.com/community/)
    or just domain.com
     
  3. Sheratan

    Sheratan Well-Known Member

    I'm planning to use some portal add-on, so my xf forum will be domain.com/forum
     
  4. MattW

    MattW Well-Known Member

    and it was previously in the document root on the subdomain?
     
  5. Sheratan

    Sheratan Well-Known Member

    Yes.

    Right now my XF forum is inside a folder, /forum folder, with a forum.domain.com subdomain.

    I wanted to move all xf forum to root, with portal as index and forum as /forum route, and add some redirect rules so I don't lose any forum.domain.com link
     
  6. MattW

    MattW Well-Known Member

    Sheratan likes this.
  7. Sheratan

    Sheratan Well-Known Member

  8. MattW

    MattW Well-Known Member

    I think you should be OK with just redirecting the subdomain to the main domain.

    Not sure if @Jake Bunce can clear things up though.
     
  9. MattW

    MattW Well-Known Member

    Code:
            RewriteCond %{HTTP_HOST} ^forum.komikanimasi.web.id
            RewriteRule (.*) http://komikanimasi.web.id/$1 [R=301,L]
    That should do the subdomain to main domain.
     
    Jake Bunce and Sheratan like this.
  10. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Not sure if that's greedy or not. I would use this to be sure:

    Code:
            RewriteCond %{HTTP_HOST} ^forum\.komikanimasi\.web\.id$
            RewriteRule ^(.*)$ http://komikanimasi.web.id/$1 [R=301,L]
    
     
    MattW and Sheratan like this.
  11. Sheratan

    Sheratan Well-Known Member

    Sorry for asking again. I need to put that rules inside htaccess /forum folder or inside htaccess root?
     
  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Inside of the .htaccess in the /forum folder, right after RewriteEngine On
     

Share This Page