- Create Account

Trouble with ajax and isapi rewrite

Forums > HTMLHttpRequest > Trouble with ajax and isapi rewrite
Author
Message

1) rojeti Group: Members
Posts: 2 Joined: 13 Mar 2008 Location: IP: 200.61.--.--
Hi,

I have a problem when I use rewrite for subdomains, it happens that when I enter this path:
user.mysite.com

it  redirects to www.mysite.com/default.asp?id=user

Everything works fine except that I get an error "Access Denied" on the HTMLHttpRequest
line doc = iframe.contentDocument  || iframe.document;

It  doesn't happen when I go directly to www.mysite.com/default.asp?id=user

Sorry for my bad english

Thanks in advance!

2) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 202.137.--.--
Yes, that will happen as the domain name is different. Make sure you only ask the script to access files from the same domain on which it's currently running. This is a browser security rule (in browsers not supporting HTML5), the alternative would be to put a small CGI proxy script on the current domain and access other domains via that :).

-  Angus.

3) rojeti Group: Members
Posts: 2 Joined: 13 Mar 2008 Location: IP: 200.114.--.--
Thanks a lot!

You say that if I'm asking the script to load an asp file with the path "http://www.mysite.com/file.asp" instead I should ask for "http://user.mysite.com/file.asp" ?

Thanks in advance!


4) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 203.109.--.--
I'm saying that if the script is running on http://foo.bar.example.com then you can only really request documents from http://foo.bar.example.com without doing some trickery.

- Angus.

Post a Reply:

You are not logged in, and will be posting anonymously as a guest. If you want to post using an account, please login at the top of this page.