Cross-domain request issue
Posted by: shrdlu1497 (---.lnse5.ken.bigpond.net.au)
Date: July 20, 2014 12:19PM

I have installed Wampserver 2.5 and run it as administrator. It shows the Homepage and a list of the folders I have under c:\wampserver\www. If I click on the name of one of the folders e.g. maps I get the message

Firefox can't find the server at maps.

If I run open an html file which runs javascript including the line

XMLHttp.open("GET","[localhost];, false);

Firefox comes back with an error:

GET [localhost] [HTTP/1.1 404 Not Found 0ms]

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at [localhost]. This can be fixed by moving the resource to the same domain or enabling CORS.

I'm running Windows 7 Home Premium. I have edited the hosts file to uncomment the two lines

127.0.0.1 localhost
::1 localhost

I changed the apache config file lines

Listen 0.0.0.0:8080
Listen [::0]:8080

which originally had :80 as MS IIS uses port 80

but it doesn't help. It doesn't matter whether I have wampserver online or offline.

Thanks in advance.

Options: ReplyQuote
Re: Cross-domain request issue
Posted by: Otomatic (Moderator)
Date: July 20, 2014 06:49PM


Options: ReplyQuote
Re: Cross-domain request issue
Posted by: shrdlu1497 (---.lnse5.ken.bigpond.net.au)
Date: July 21, 2014 04:39AM

Thanks. I did all that, but I still get the same Cross-Domain issue. I'm confused as to whether I should be using 80 or 8080 in the host name. (I use Win 7). I cannot get the Hosts menu to appear on the Wampserver host page.

Options: ReplyQuote
Re: Cross-domain request issue
Posted by: shrdlu1497 (---.lnse5.ken.bigpond.net.au)
Date: July 21, 2014 09:12AM

I looked through everything in the new "Sticky" topic about this. I'm sure I've got everything edited correctly. If I click on MyVirtualHosts in the Wampmanager side menu., it shows two lines beginning with # then localhost and Maps (my project folder is C:|wampserver\www\Maps. But I still don't get the virtual hosts menu in the wampmanager screen and my html still fails with the cross-domain error.
THanks

Options: ReplyQuote
Re: Cross-domain request issue
Posted by: Otomatic (Moderator)
Date: July 21, 2014 10:21AM

Hi,

Use port 80 and inactive IIS
- Control Panel, Programs and Features, Enable or disable Windows features
Uncheck:
- Main Web Internet Information Services (IIS)
- All branch of Internet Information Services (IIS)

redo
Listen 0.0.0.0:80
Listen [::0]:80

What is the content of wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf?

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Cross-domain request issue
Posted by: shrdlu1497 (---.lnse5.ken.bigpond.net.au)
Date: July 22, 2014 06:08AM

Thanks for everyone's help. I got it all working!

Options: ReplyQuote


Sorry, only registered users may post in this forum.