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?
CodePudding user response:
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 wrote 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 building 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 got 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's was useful for you :)
CodePudding user response:
try this
google.com it will shown her