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

Forcing the board url

Andz

New member
#1
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?
 

Jake Bunce

XenForo moderator
Staff member
#2
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
 

Andz

New member
#3
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?
 

Jake Bunce

XenForo moderator
Staff member
#6
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.
 

Andz

New member
#7
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.