Trouble with YOURLs installation and Cross Origin Resource Sharing (CORS)


#1

Hello!

I’m having trouble putting together a YOURLs installation on DreamHost. The specific issue I think (but can be entirely wrong) I’m encountering is a XMLHTTP request going from my domain to a subdomain (specifically: mywebsite.com --> mysql.mywebsite.com) where a SQL database is located (since DH requires a host name that isn’t local)

The error I’m seeing in console (have anon’d the domain) is:

It seems the YOURLS maintainer has acknowledged that this can be an issue. With some searching I’ve seen two main ways to fix this issue, using CORS or .htaccess and setting origin to * in the header.

I’ve added .htaccess file with some of the recommended setups to my directory, but I think I need to get that file to the directory being called. But I have no idea where the “dir” for sql.mywebsite.com would be (if that makes sense). Alternatively using the CORS fix I’m not sure where I need to specify that snippet. I tried putting it into the admin.php file where the call is being made from but it was unsuccessful as well.

If anyone has encountered this issue and has some steps on how to fix I’d appreciate it. Thanks~

/nikatosa