Show an HTML Link with Custom link

Question:

I have a question
I’m trying to embed a link with HTML data in my own domain so that when I call up my own link, a kind of website opens where the HTML script is shown without me having to download the HTML file
I can imagine that this works with a php file but I don’t know what has to be in it

At the moment the link looks like this:

https://transcript.2icecube.de/https://cdn.discordapp.com/attachments/1024281285839028295/1024281459051200595/transcript-test.html

whereby the here: https://transcript.2icecube.de/ is my own domain

and here is the link to the html file: https://cdn.discordapp.com/attachments/1024281285839028295/1024281459051200595/transcript-test.html

However, when I call it, the error 403 always comes up and nothing else

Anyone know how I can create something like this?

Asked By: Lars0005

||

Answers:

For this question:

First Solution, using ROUTER:

it’s mean’s if someone called {YOUR_SITE_URL}/attachments/****/****, it’s just handling by your site.

For example (it’s written with PHP):

$router = new Router();

$router->all('/attachments/{data}', function ($data) {    
    echo file_get_contents("https://cdn.discordapp.com/attachments/" . $data);
});

if you don’t want to get from discord, you can Build like this:

$router->all('/embed/{data}', function ($data) {    
    echo file_get_contents($data);
});

Second Solution, add CNAME to your domain

I’m not exactly sure is this working or not

add CNAME to your domain like this:

CNAME data.2icecube.de TO cdn.discordapp.com

In this case, you just say to your nameserver if you get request like this:

https://data.2icecube.de/attachments/1024281285839028295/1024281459051200595/transcript-test.html

send it to :

https://cdn.discordapp.com/attachments/1024281285839028295/1024281459051200595/transcript-test.html

I hope it was helpful for you 🙂

Answered By: Alex J
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.