'Redirect my sub.my-domain.com to discord

I've been looking for a method with DNS to redirect my domain's subdomain e.g http://server.my-domain.com to https://discordapp.com/invite/server



Solution 1:[1]

As i found the answer of this question, i'd love to share it with all of you,

  1. Create a CNAME on your domain named server: (or any other name you want)
  2. Target the CNAME to: discord.gg.opts-slash.INVITECODE.redirect.center but change the INVITECODE to your server invite code
  3. Save it and you are good to go!

Please note that: If you want to use it for another method other than discord please remember:

.opts-slash means / for example you have http://example.com/123, to redirect your http://example.my-domain.com/ to http://example.com/123 type in the CNAME example.com.opts-slash.123.redirect.center and your CNAME name to example.

Solution 2:[2]

As i couldn't get it to work redirecting it directly through a CNAME, i had success by creating a simple netlify app which is just redirecting via JS:

  1. Create index.html with the following content:

<html>

<head>
  <title>Discord redirect</title>
</head>

<body>
  <script>
    window.location.replace("https://discord.com/invite/INVITECODE");
  </script>
</body>

</html>
  1. Place the index.html inside a folder and upload it to netlify
  2. You'll get a unique name, such as eloquent-noyce-x00xx0
  3. Set a CNAME to your app with eloquent-noyce-x00xx0.netlify.app. (last dot is important!)
  4. Set your mydiscord.mydomain.com as custom domain in netlify
  5. That's it, visit mydiscord.mydomain.com and it'll redirect you

Solution 3:[3]

For me redirect like previous answer doesn't work. Free (minus the domain name) and easy solution is to use Amazon Web Services. Create an AWS account and follow this guide:

https://kennbrodhagen.net/2016/04/02/how-to-return-302-using-api-gateway-lambda/


Then use Route53 to create a CNAME to redirect to the API Gateway:

How to CNAME to Amazon API Gateway Endpoint

Solution 4:[4]

1) Create a Discord invite that never expires.

2) Use the .GG URL to find the .COM URL. You will be redirected in the browser when you paste the .GG URL into the browser.

https://discord.gg/abc12de (redirected to) -> https://discordapp.com/invite/abc12de

Note: abc12de (example) stays the same between the two URLs.

3) In your GoDaddy domain, scroll down and to the right. Select Forwarding.

4) FORWARD TO: (Drop down) https:// (fill in box) discordapp.com/invite/abc12de <- Note: remove https from the original URL.

5) FORWARD TYPE: Permanent (301)

6) SETTINGS: Forward Only

7) Save and wait.

8) You'll notice a new A Record is created with a TTL of 600 seconds. This shows your settings have taken and should now work.

URL with additional info: https://www.godaddy.com/help/forward-my-domain-12123

Solution 5:[5]

This worked for me: Create a "A" DNS Record with name "discord" pointing to 8.8.8.8 Create a page rule of url forwarding to your server invite called "discord.mydomain.com" The CNAME way doesn't work!

Solution 6:[6]

It works for me thanks full tutorial in case someone understood it.

This is for CloudFlare

Created Add Record "A"

this type "A" must contain in Name: "Name you want for the sub domain", and in IPv4 address they must place "8.8.8.8", Proxy status activated.

IMG Add Record

Then they go to "Rules"

Here they add a Create a new rule, and place the following data in URL: "yoursubdomanin.yourdomain.com", luen in Then the settings are: Select "Forwarding URL", then in Select status code: Select "301 - Permanent Redirect"

in Enter destination URL (required) you put the url of the Discord invitation: "https://discord.gg/yourInviteCode".

IMG Rules

That's how it works, in case it doesn't load you because you have already tried many methods with "discord.yourdomain.com", try another subdomain while the other one is reactivated or try from another device, example of another dub domain "discord1. yourdomain.com".

That's bye :D

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gecko
Solution 2
Solution 3 TecHunter
Solution 4 advgmni
Solution 5 Ibrahim Khurram
Solution 6 HappyRogelio7