WebFaction
Community site: login faq

Hello,

I have set up a standard cgi/php/static application that is based on a core set of PHP files. It is based on AJAX calls to these php files that provide dynamic content for each 'page'.

The application is such that multiple versions of this 'website' are configured with a few different scripts contained in subfolders contained within this application, that also contain a new index.php page;

i.e each new folder with configuration files = A new 'website' based on core files that comunicate with the configuration scripts.

As a result of this behaviour, it is preferable to give each of the 'websites' a different domain. This can be achieved by creating a symbolic link app and directing it to the index.php file in the configuration folder.

However, the server will not execute the php code in the core file folder when it is called cross domain! It will deliver any static pages of javascript files or resources like images, but the server will not process any php code.

I have tried adding;

header("Access-Control-Allow-Origin: *");

But to no avail,

Thanks in advance,

Hugh

asked 09 Feb '12, 06:12

hughcrail
111
accept rate: 0%


Could you try adding the following line in your .htaccess at the root of your application's directory and let us know it works?

Header set Access-Control-Allow-Origin *

permanent link

answered 09 Feb '12, 08:57

iliasr ♦♦
2.1k14
accept rate: 35%

That was actually already set in my .htaccess file, however with just this set, the page wont even deliver the static content included in the php file,

That is why I had to add header("Access-Control-Allow-Origin: *"); to each of the scripts manually, this allows the server to serve the static content included in the php files but it does not execute any of the php code.

I understand that what you did was a shortcut to my manual altering of each php file, I think my .htaccess file may be configured badly, any tips would be appreciated!

(09 Feb '12, 09:22) hughcrail

If you think that your .htaccess is misconfigured then you'd better open a support ticket so we could take a look at it. You can open a ticket via our ticketing system or via the 'Support' menu item at our control panel.

(09 Feb '12, 10:45) iliasr ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×262
×128
×8

question asked: 09 Feb '12, 06:12

question was seen: 3,706 times

last updated: 09 Feb '12, 10:45

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM