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

.htaccess problem, bad url after hosting change

We have moved from old webhosting because they did not allow database larger than 250MB and it was pricey. This webhosting had all subdomains in the root with www folder. New webhosting hass all subdomains in /www/subdom/ folder. So our Wordpress sites works fine but Xenforo has troubles.

The url http://forum.majncraft.cz/ works fine, but the real working url is http://forum.majncraft.cz/subdom/forum.
The problem is just when clicking the buttons for links or media when editing post and when trying to enter admin.

The solution would be to redirect users which enters the forum.majncraft.cz to forum.majncraft.cz/subdom/forum but this redirection does not work for some reason. I am trying to resolve this with webhosting supports, but they have not been really helpfull yet.
Anyone had similiar problem with this?

Jake Bunce

XenForo moderator
Staff member
Both URLs point to the same site? That's weird. The subdomain should root to /subdom/forum.

This may be a pathing problem that RewriteBase can fix. Try uncommenting this line in your .htaccess file:

Rich (BB code):
	#	If you are having problems with the rewrite rules, remove the "#" from the
	#	line that begins "RewriteBase" below. You will also have to change the path
	#	of the rewrite to reflect the path to your XenForo installation.
	#RewriteBase /xenforo
And specify your path. I'm thinking RewriteBase /
Thank you, but this options does not seem to have any effect. I can specify any path and it still does the same.
But When I turn off Full Friendly URLs, forum from http://forum.majncraft.cz links to every threads in http://forum.majncraft.cz/subdom/forum. But link to threads such as http://forum.majncraft.cz/threads/rozdělení-fóra.1741/ does not work anymore as they need ...cz/subdom/forum/threads links, so this is not an option. :-/

I guess the .htaccess in root is the one making problems with the RewriteBase in forum subdomain.
The part of .htaccess in root that takes care about subdomains looks like this:

# subdomains
RewriteCond %{REQUEST_URI} !^subdom/
RewriteCond %{REQUEST_URI} !^/subdom/
RewriteCond %{HTTP_HOST} ^(www\.)?(.*)\.([^\.]*)\.([^\.]*)$
RewriteCond %{DOCUMENT_ROOT}/subdom/%2 -d
RewriteRule (.*) subdom/%2/$1 [DPI]
Webhosting support still has not been helpful at all.

Jake Bunce

XenForo moderator
Staff member
I would change the server config to root the subdomain properly, then get rid of those rewrites in the current root. Or even just move the forum to the current root and then get rid of those rewrites.