Domain Manager

Deleted User's Avatar
Deleted User · in Support
3 replies 236 views

Is there a way to set up a domain and use it as primary and whenever someone goes to the original subdomain that it forces the new domain name?

0

You can accomplish this with a piece of JavaScript in the head section, for example:

<script>
const defaultDomain = 'sparkpromotion.forumspark.net';
const customDomain = 'google.com';

if (window.location.hostname === defaultDomain) {
    window.location.href = 'https://' + customDomain + window.location.pathname + window.location.search;
}
</script>

0

Would be easier to have it as default especially if this platform allows custom domains.

Does that code do a wildcard redirect?

0

Yeah, it's annoying that happens. I'll look into this if I can fix that. I'll keep you updated.

Theme: FS 2.0
Create Your Community with ForumSpark

ForumSpark is a modern community platform built on custom software. It combines the familiar feel of classic forums with a fast, simple experience designed for today’s communities.