MyBB Community Forums

Full Version: Change old subdomain to domain
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

So i was using a subdomain and a domain with the myBB hosted in the subdomain.

As the time passed i decided to move all the content from the subdomain and changed it to the domain.

in this case:
 SubDomain (deleted): forum.techinbermudas.com
 MainDomain: techinbermudas.com

As i have many links spread online as the old subdomain is there a way to make them redirect to the Main Domain?

eg: instead of forum.techinbermudas.com/thread-1 it redirects automatically to techinbermudas.com/thread-1
You can do it with a rewrite rule on your server. The rule syntax will depend on your httpd (apache, nginx, ...)
For nginx:
server{
    server_name forum.techinbermudas.com;
    rewrite ^ http://techinbermudas.com$request_uri permanent;
}

For apache:
RewriteCond %{HTTP_HOST} ^forum\.techinbermudas\.com$ 
RewriteRule ^(.*)$ https://techinbermudas.com/$1 [P]
(2021-10-03, 08:24 AM)Crazycat Wrote: [ -> ]You can do it with a rewrite rule on your server. The rule syntax will depend on your httpd (apache, nginx, ...)
For nginx:
server{
    server_name forum.techinbermudas.com;
    rewrite ^ http://techinbermudas.com$request_uri permanent;
}

For apache:
RewriteCond %{HTTP_HOST} ^forum\.techinbermudas\.com$ 
RewriteRule ^(.*)$ https://techinbermudas.com/$1 [P]

i've done that on main domain [apache] (htcaccess) and didn't worked out.
goes to a 404 page still.
Well, you want to redirect subdomain to main domain, so you have to do that on subdomain, not on main.
(2021-10-03, 02:28 PM)techinbermudas Wrote: [ -> ]
(2021-10-03, 08:24 AM)Crazycat Wrote: [ -> ]You can do it with a rewrite rule on your server. The rule syntax will depend on your httpd (apache, nginx, ...)
For nginx:
server{
    server_name forum.techinbermudas.com;
    rewrite ^ http://techinbermudas.com$request_uri permanent;
}

For apache:
RewriteCond %{HTTP_HOST} ^forum\.techinbermudas\.com$ 
RewriteRule ^(.*)$ https://techinbermudas.com/$1 [P]

i've done that on main domain [apache] (htcaccess) and didn't worked out.
goes to a 404 page still.

ah basically i re-created the subdomain all over again and redirect everything using this:

Redirect 301 / https://example.com/