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

XF 1.5 Switching from subdomain

Discussion in 'XenForo Questions and Support' started by albnaldo, Aug 16, 2015.

  1. albnaldo

    albnaldo Member


    I created a subdomain on my site and installed Xenforo. It is like forum.mysite.com, but for some reason the forum also appears when I go to mysite.com/forum. Now what is the best way to remove the subdomain forum and only have mysite.com/forum and forum.mysite.com redirects to mysite.com/forum?
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Add this to the top of your .htaccess file to enforce one URL:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^mysite\.com$
    RewriteRule ^(.*)$ http://mysite.com/forum/$1 [R=301,L]
    That should do it.
  3. albnaldo

    albnaldo Member

    This redirect works only if the subdomain stays alive, right? If I delete the subdomain, will mysite.com/forum also get deleted. How can I have mysite.com/forum and forum.mysite.com redirect to that link, but the subdomain is completely removed from the server?
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The subdomain will need to remain on the server so that both URLs are active. Then the rewrite rule will enforce redirects to just the one URL.

Share This Page