Mobile app version of vmapp.org
Login or Join
Harper822

: Cleanly redirecting a subdomain to an address with a different application layer protocol A particular gaming platform allows clients to connect to game servers by entering a URL into their web

@Harper822

Posted in: #Dns #Redirects

A particular gaming platform allows clients to connect to game servers by entering a URL into their web browser. Upon entering the URL in the web browser and pressing enter, the application launches and joins the specified server. This URL takes the form of a specific application layer protocol, followed by an IP address and port. Ex. xyz://server-ip:port

I wish to redirect a subdomain of my website to the address of my game server. If my domain is example.com, I'm looking for play.example.com to redirect to xyz://server-ip:port.

Using a forward resource record did not work, nor did using a PHP header redirect, presumably because both are strictly HTTP redirects. Some ideas that I've had include using a <meta> tag, a .htaccess file, javascript, or another resource record, but I'm not familiar enough with any of them to know which, if any, are viable.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Harper822

1 Comments

Sorted by latest first Latest Oldest Best

 

@Shakeerah822

Without knowing the specific game I can't test these, but here are a couple things to try:

First, try a proper Apache redirect in your virtualhost instead of a rewrite (I assume Apache since you mention .htaccess).

<VirtualHost *:80>

ServerName play.example.com
Redirect permanent / xyz://server-ip:port

</VirtualHost>


If that doesn't work, try framing the game page with an iframe. You'll need to create a virtualhost for play.example.com and serve a very basic index.html page with your iframe. This may work:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Title goes here</title>
<!-- iframe may need some CSS to fit page, etc. -->
<style>iframe{}</style>
</head>
<body>
<iframe src="xyz://server-ip:port" ></iframe>
</body>
</html>

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme