QUICK NEWS

{NEW} - A new css video is up.

{OLD} - New video courtesy of Skhilled, Thanks for posting it up.

Video of the moment:


Internal Links

SMF Sites

Quick Info

Direct file links from website to website

Started by Dave, Sep 29, 2025, 08:12 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dave

All,

I have Chen's Arcade on my main website which, file wise, is beginning to get full up. So I thought I'd link the ROM games offsite from another hosting plan I have for another site of mine, lets call it 'Host'.

What I've done so far is to create a folder in the root of 'Host' called 'test', I then upload a ROM game file to the 'test' folder and then link it to the game settings on the site where the arcade is lets call it 'Main'.

The link I'm using is
https://www.davejohnson.co.uk/test/AdvanceGuardianHeroesUSA.gba if you copy and paste that into your browser the game file will auto download to your PC, it's perfectly safe I promise you.

When I insert that link into the place in the Arcade on 'Main', see attached image, it doesn't work when the game is run it says there's a 'Network Error'

If I upload that file to Contabo to one of my buckets and copy the link and paste it into the external link box it will link to the game and run OK on 'Main'. This is the Contabo link
https://eu2.contabostorage.com/cfedffae94734130b2b6499e91d020d5:roms/GBA/AdvanceGuardianHeroesUSA.gba
So why wont it do it from the www.davejohnson etc? What could block the file being directly downloaded from 'Host' to the the 'Main' site?

Any help is much appreciated

NOTE: CHMOD permission are fine for the 'test' folder 755, I have tried 777 which I know is dangerous but just wanted to see if it was a factor.

Both 'Host' and 'Main' are with the same hosting company but are on different packages.

Skhilled

#1
I'm not sure why it does it but I assume that there's a difference between the two.

EDIT: I was just thinking... If they are on the same hosting but different packages then maybe the packages are somehow setup differently.

I did notice that you said "buckets" for the 2nd link but not the first. Maybe that's the difference?

Neša

Just a heads up, the gaming company that starts with N is crawling sites for roms, maybe rename the link in this thread.
Not sure if they will flag your site.

Do you get a http error code like 403, or anything in the access.log file?


Dave

#3
Quote from: Neša on Sep 29, 2025, 06:40 PMJust a heads up, the gaming company that starts with N is crawling sites for roms, maybe rename the link in this thread.
Not sure if they will flag your site.

Do you get a http error code like 403, or anything in the access.log file?

No errors Nesa, I have a lot of those files on the main arcade, thanks for the heads up.

Neša

I joined, I tried the game.
I can see that it is hosted on the quizland.co.uk site, I can try to trouble shoot some games if you tell me the ones that are hosted on the dave url.


Dave

Sorry Nesa, my son is here for a few days so I'm a bit busy at present. I'll sort it out later tomorrow, thanks for the reply though.

Neša

Quote from: Dave on Oct 02, 2025, 04:18 PMSorry Nesa, my son is here for a few days so I'm a bit busy at present. I'll sort it out later tomorrow, thanks for the reply though.
No need for an apology it isn't a critical thing, spend time with your son.


Dave

Hi Nesa,

I have made you Arcade Admin to see if that helps you help me ;)

The game that has the link to it is as the davejohnson.co.uk link in the first post. To see it on the website go here
https://www.quizland.co.uk/index.php?action=retro_arch;sa=play;game=6940
As I said above if you use the Contabo link it works fine. For information, I did rename my .htaccess file to see if there was anything in that which would prevent it from connecting, but then I thought about the fact I can direct link to smilies on the site as I have in this post and there are no issues, plus both links in the first post allow the file t be downloaded and that's what I don't understand

Skhilled

So, my question is... are you use object storage buckets for both links?

Neša

#9
I had a hunch it might be CORS and it is.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS/Errors/CORSMissingAllowOrigin?utm_source=devtools&utm_medium=firefox-cors-errors&utm_campaign=default

You could try adding the required section in .htaccess https://nestnepal.com/blog/enable-cors-in-cpanel-for-cross-domain-access/

You would change
Header set Access-Control-Allow-Origin "*" to be
Header set Access-Control-Allow-Origin "https://www.davejohnson.co.uk"from his example.

It should look something like this.
<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "https://www.davejohnson.co.uk"
    Header set Access-Control-Allow-Methods "HEAD, GET"
    Header set Access-Control-Allow-Headers "Content-Type, Authorization"
</IfModule>

I've turned off the CORS check for your site using a plug in and the game loads for me.




Dave

#10
Thanks very much Nesa.

Those options didn't work for me. I tested the CORS by opening F12 and the settings show as per the attached image.

However I have got it to work, instead of
https://www.davejohnson.co.uk I used
https://IP address:443 and for me the game now works. To test that it is coming from the remote site I changed the file name in the Quizland Rom storage folder and it's still works fine.

Without your help I would never have gone down that route so thanks again Nesa  :vcool

Neša



Dave

I've update the previous post Nesa, you replied before I'd finished  ;D

NOTE: I didn't get the email notification for your first reply until after I had read the post this morning, not sure why it's being delayed, but the same thing has happened before on this site

Dave

#13
Another update.

As in the previous post the games works using the sites IP address. I found I didn't need the
IP:443 as the game works without it, but now when I test play the game I get an SMF error as per the image attached, the game plays fine and loads as it should, again if I substitute the IP address for the normal website the game doesn't play.

I will keep testing stuff over the next few hours and if I find anything I'll let you know.

Please don't spend to much time on this, now I'm retired it's something I do to pass the time, but I'm sure you have better things to do. If something sticks out then please let me know other than that please feel free to ignore it  :rgton


NOTE: I have now removed the link address from the 'Optional External Link' so the file will play from the internal Quizland folder

Neša

It's interesting that the game works with the IP alone.
In shared hosting they use a virtual site, they have one IP and configurations with different URLs that will route to different sites.
This works because you send a reference to the web server of the URL you are trying to get to.

The email delay is happening on some SMF 2.1.6 forums, they say it should be fixed in 2.1.7

Have you tried to make it https://www.davejohnson.co.uk/test/? not sure if it will fix it /test is just a directory.