redirect /forum to subdomain

~kevin~

Member
I have tried looking up this answer for a week, and have tried various forms of redirects in htacess, but to no avail.

Both /forum and subdomain.domain name work, but only one lets you log in.

I have wordpress installed in the html root, created a /forum page in wordpress, and would like to redirect /forum to the subdomain. In the past when I had the forum installed in a /forum folder under wordpress, there have been issues with wordpress displaying an error page rather than the forum.

When I tried using the htacess file to redirect to the subdomain, the redirect never worked. Maybe because /forum folder and the subdomain are the same thing?

I have tried these examples:

Redirect /forum https://forum.example.com/

Redirect 301 /forum http://forum.example.com[/noparse]

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^example.com/forum/ [nc]
RewriteRule .? https://forum.example.com%{REQUEST_URI} [R=301,L]

I am trying not to post a link to the site
 
So, you are using a hosting panel that stores subdomain data inside the primary site folder. I have seen this before and it was kind of messy because you couldn't have a folder with the name of the subdomain inside the primary site folder.

You mentioned that you deleted the subdomain. If that's done, how is subdomain still working?
But you also say that you want to redirect /forum to the subdomain?

It is kind of confusing why the redirect from /forum to subdomain won't work if they are set in the home folder where wordpress is located. Also, the canonical link feature in XenForo should technically handle this issue. The simplest fix probably would be to hard code the link with subdomain for login so that when the users click on it, they are shown the link hosted on the subdomain.
 
Top Bottom