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

Forcing the board url

Discussion in 'Troubleshooting and Problems' started by Andz, Feb 20, 2012.

  1. Andz

    Andz New Member

    How can I force all links in xenforo to use a different subdomain?

    I am currently using the rewrite engine to mask urls from domain.com to www.domain.com. (And yes, I need to mask, I can't redirect.)

    The problem is, all the links still link to www.domain.com.

    I'd like to remove the www. from all links. Setting the board url in admin options doesn't change anything.

    Is there a variable in some file that I can change?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    All links use the base href that is defined in the head. For example:

    Code:
    <base href="http://xenforo.com/community/" />
    
    The base href gets the URL from the actual page request. By way of the base href, all internal links preserve the URL that you use to access the forum. If you use "www" then all links on the page will contain "www".

    This rewrite rule might be useful:

    http://xenforo.com/community/threads/redirecting-www-to-non-www.14554/#post-190967
     
  3. Andz

    Andz New Member

    I changed the base href in the templates, and it does change all the links to images, css, javascript, since those links are relative URLs.

    But all links to actual pages are absolute URLs, and use the www. in it.

    As an alternative, is it possible to just set all links to use relative URLs?
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    They are relative for me. I am not aware of an option to make them full. What is the forum URL?
     
  5. Andz

    Andz New Member

    http://gw2.eu.com

    If you view the source (or just look at some of the links), they are linking to the www. version of the URL and use full URLs.
     
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Almost all of the links are relative, except for the breadcrumbs and some XenMedio links. I'm not sure how to change the XenMedio links off hand. The breadcrumbs look to the URL of the current page request as well as the Board URL setting in the Admin CP.
     
  7. Andz

    Andz New Member

    Ah, I see. I must have had the page cached or something, I couldn't see the updated links.

    Oh well, I think I'm just going to keep the www., seems to be a lot of trouble trying to get this to work.
     

Share This Page