# Same site, different domain, strange behaviour

**URL:** <https://forum.infinityfree.com/t/same-site-different-domain-strange-behaviour/63720>\
**Category:** Hosting Support\
**Created:** [July 11, 2022, 12:12am UTC](https://forum.infinityfree.com/t/same-site-different-domain-strange-behaviour/63720 "2022-07-11T00:12:17Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![uzer1234](https://forum.infinityfree.com/letter_avatar/uzer1234/32/6_22734026db12803ebb3e059622ac3534.png) [@uzer1234](https://forum.infinityfree.com/u/uzer1234)\
**Post date:** [July 11, 2022, 12:12am UTC](https://forum.infinityfree.com/t/same-site-different-domain-strange-behaviour/63720/1 "2022-07-11T00:12:17Z")

</div>

I have the same website uploaded with free infinityfree host:

1. with a free epizy domain: [https://farmeasy.epizy.com/speech\_2\_dymo/index.html](https://farmeasy.epizy.com/speech_2_dymo/index.html)  
and
2. with a paid cc domain: [https://www.speaklabel.cc/](https://www.speaklabel.cc/)

### The issue

Although the website files are completely the same in both hosting accounts, the site appearance is very different, and i can see that the second link give me this error:

> “Access to XMLHttpRequest at ‘[https://infinityfree.net/errors/404/](https://infinityfree.net/errors/404/)’ (redirected from ‘[https://www.speaklabel.cc/jquery.hotkeys.js?\_=1657498117611](https://www.speaklabel.cc/jquery.hotkeys.js?_=1657498117611)’) from origin ‘[https://www.speaklabel.cc](https://www.speaklabel.cc)’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: Redirect is not allowed for a preflight request.”

Is there any free host with paid domain limitation? Or else i can not find any logical explanation for this.

---

<div class="post-metadata">

**Author:** ![wackyblackie](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/wackyblackie/32/43350_2.png) [@wackyblackie](https://forum.infinityfree.com/u/wackyblackie)\
**Post date:** [July 11, 2022, 12:16am UTC](https://forum.infinityfree.com/t/same-site-different-domain-strange-behaviour/63720/2 "2022-07-11T00:16:45Z")

</div>

> [@uzer1234](#):
>
> > “Access to XMLHttpRequest at ‘[https://infinityfree.net/errors/404/’](https://infinityfree.net/errors/404/%E2%80%99) (redirected from ‘[https://www.speaklabel.cc/jquery.hotkeys.js?\_=1657498117611’](https://www.speaklabel.cc/jquery.hotkeys.js?_=1657498117611%E2%80%99))

Make sure that `jquery.hotkeys.js` was actually uploaded.

---

<div class="post-metadata">

**Author:** ![uzer1234](https://forum.infinityfree.com/letter_avatar/uzer1234/32/6_22734026db12803ebb3e059622ac3534.png) [@uzer1234](https://forum.infinityfree.com/u/uzer1234)\
**Post date:** [July 11, 2022, 12:22am UTC](https://forum.infinityfree.com/t/same-site-different-domain-strange-behaviour/63720/3 "2022-07-11T00:22:51Z")

</div>

Yes it is. I rechecked. Although the problem is not limited to the hotkeys anyway.

---

<div class="post-metadata">

**Author:** ![wackyblackie](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/wackyblackie/32/43350_2.png) [@wackyblackie](https://forum.infinityfree.com/u/wackyblackie)\
**Post date:** [July 11, 2022, 12:27am UTC](https://forum.infinityfree.com/t/same-site-different-domain-strange-behaviour/63720/4 "2022-07-11T00:27:19Z")

</div>

It is obviously not there if it is returning a 404 error.  
Please try uploading it again.

 ![image](https://forum-cdn.infinityfree.net/original/3X/8/0/8004785cd00e7a2b805158c824dd12bf1171de69.png)

All of the files listed on the right are not present on the server.

---

<div class="post-metadata">

**Author:** ![uzer1234](https://forum.infinityfree.com/letter_avatar/uzer1234/32/6_22734026db12803ebb3e059622ac3534.png) [@uzer1234](https://forum.infinityfree.com/u/uzer1234)\
**Post date:** [July 11, 2022, 12:40am UTC](https://forum.infinityfree.com/t/same-site-different-domain-strange-behaviour/63720/5 "2022-07-11T00:40:31Z")

</div>

its strange, as i can see all these files in the File Manager.  
Also, i tried to delete and reupload VisitorManagement.js and it still gets a 404.  
And i have already tried to reupload everything in the past.

---

<div class="post-metadata">

**Author:** ![wackyblackie](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/wackyblackie/32/43350_2.png) [@wackyblackie](https://forum.infinityfree.com/u/wackyblackie)\
**Post date:** [July 11, 2022, 12:58am UTC](https://forum.infinityfree.com/t/same-site-different-domain-strange-behaviour/63720/6 "2022-07-11T00:58:51Z")

</div>

Is it a parked domain or an addon domain?

---

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [July 11, 2022, 3:00pm UTC](https://forum.infinityfree.com/t/same-site-different-domain-strange-behaviour/63720/7 "2022-07-11T15:00:31Z")

</div>

The files are indeed the same, but the URLs you are using are different.

On the free subdomain, you are accessing the index.html file in the `speech_2_dymo` folder. And in the HTML code, the URLs are all relative to the current folder, so the URL to a file looks like `https://farmeasy.epizy.com/speech_2_dymo/jquery.hotkeys.js?_=1657551125747`.

On the custom domain, you are accessing the page as `https://www.speaklabel.cc/`. So the final URLs look like `https://www.speaklabel.cc/assets/vendor/popper/popper.min.js`.

However, like with the free subdomain, all the website files are located in the `speech_2_dymo` folder, not the main htdocs folder, which is why the files cannot be found.

There are roughly two ways to fix this:

- Simply move all the files from the speech\_2\_dymo folder to the main htdocs folder.
- Setup .htaccess rules to remap all (non-existent) URLs in the main folder to the speech\_2\_dymo folder.

---

<div class="post-metadata">

**Author:** ![uzer1234](https://forum.infinityfree.com/letter_avatar/uzer1234/32/6_22734026db12803ebb3e059622ac3534.png) [@uzer1234](https://forum.infinityfree.com/u/uzer1234)\
**Post date:** [July 11, 2022, 6:56pm UTC](https://forum.infinityfree.com/t/same-site-different-domain-strange-behaviour/63720/8 "2022-07-11T18:56:49Z")

</div>

First of all thank you for the quick and detailed response.  
Solution 1 worked just fine.

Although, i cannot still understand why i had this folders conflict, as i always use relative links and not “hardcoded” full links e.g. I dont use `https://farmeasy.epizy.com/speech_2_dymo/jquery.hotkeys.js?_=1657551125747` but `/jquery.hotkeys.js` or something like that.

---

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [July 12, 2022, 3:38pm UTC](https://forum.infinityfree.com/t/same-site-different-domain-strange-behaviour/63720/9 "2022-07-12T15:38:16Z")

</div>

How you format the links makes a huge difference on how the browser interprets them. So it’s very useful to understand the different ways to write URLs and how they are handled by browsers.

> <https://stackoverflow.com/questions/2005079/absolute-vs-relative-urls/21828923#21828923>

It’s not really a “conflict”. The file you’re trying to use is located at `https://www.speaklabel.cc/speech_2_dymo/jquery.hotkeys.js`. So on the HTML page, you need to place a URL that ultimately goes to that specific URL.

If you then use the URL which is just `jquery.hotkeys.js`, the browser will understand this URL as being relative to the current directory. So on `https://farmeasy.epizy.com/speech_2_dymo/index.html`, this becomes `https://farmeasy.epizy.com/speech_2_dymo/jquery.hotkeys.js`, which is good. But on `https://www.speaklabel.cc/index.html`, this becomes `https://www.speaklabel.cc/jquery.hotkeys.js`. And that’s a different URL, which is why it doesn’t work.

To serve a file on a website, you need to tell the server _exactly_ where to find it. You can’t just give it a file name and it will just kinda search your account for a file somewhere in some folder that might be the one you’re looking for. That search operation is theoretically possible, but would be extremely slow at scale, but it’s generally quite easy to fix through code.

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [July 19, 2022, 3:38pm UTC](https://forum.infinityfree.com/t/same-site-different-domain-strange-behaviour/63720/10 "2022-07-19T15:38:29Z")

</div>

Closed on July 19, 2022, 3:38pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
