0

I have a fairly have project up and running online, using the codeigniter framework. The project is deployed on my server on AWS. In a aws, it's stored under: /var/www/html/gitprojects/purimproject I didn't want everyone to have to type http://urlname.com/gitprojects/purimproject so I changed the httpd.conf so that the base url is under gitprojects, so now you access purim project by doing http://urlname.com/purimproject. When I did this, the whole system broke as suddenly the browser could not make AJAX calls to my api (on the same server, which had worked previously), saying they were cross origin requests, although they're not. It's trying to post from http://urlname.com to http://urlname.com/purimproject/index.php/controllername , but this isn't working. Any idea what could have possibly changed?

maor10
  • 1,352
  • 14
  • 28
  • 3
    If you remove http:// urlname.com from your AJAX requests and simply start them with a forward slash, do they work? – Ben Fried Jul 21 '15 at 20:17
  • ^ This. It's possible that if cross-origin requests aren't enabled for urlname.com, that using the full url to access something is throwing those errors. Try referencing your calls at a more local level. Alternatively, depending on your server access, you could enable CORS, it's quite easy to do so. – Tony M Jul 21 '15 at 20:25
  • Scratch it- everything working. Ben Fried, please add this as an answer so I can give you credit – maor10 Jul 21 '15 at 20:47
  • 1
    Did you enabled CORS? If so cookies are not send with ajax if origin doesn't match. You can read more from here: http://stackoverflow.com/a/7189502/2112228 – sharko Jul 21 '15 at 20:48

0 Answers0