madskristensen/MiniBlog

hosting as application within iis application

dyardyGIT opened this issue · 0 comments

I am hosting mini blog on 3rd party hoster. If i want to host multiple small sites I am required to have 1 directory and put different sites within this root application directory (root).

So, I have it setup like follows..

Root (directory application and http://root.com)
web.config (with url-rewrite rules)
***MySite (directory application is the target directory when someone navigates to root.com
rewrite rules will redirect to the path root/mysite)
{miniblog is here with it's own web.config}

I had issues with references using ~ so to avoid this i simply just replaced with full name and I avoided that. I believe there is a way to ensure ~ resolves appropriately.

The second issue is logging-in.

I navigate to http://root.com/login (the url-rewrite rules) redirects to the appropriate login page within mysite directory and shows username and password textboxes. After I provide correct user/pwd and submit the form I was getting

Error 400
Bad request: The request cannot be fulfilled due to bad syntax

I say 'was' because if i temporarily removed ValidateAntiForgeryToken I could avoid this error (I figured it was posting back from a path that is different than expected as a result of the rewrite rules). Again, at this moment avoiding that, I am redirected back to the root.com (and redirected to root.com however it is not recognizing I am authenticated (no edit blog link). If however I type root.com/mysite in the path the site says i am authenticated and I now see the edit link. So the claim is getting set but it appears that the claim is set at the file path root.com/mysite and it is only recognized if the url path matches.

I do believe this is a pretty common scenario, and I figure something is not quite right (potentially with rewrite rules or web.config).

In the root web.config, i did wrap system.webservicer with so that web.config settings from the parent did not move downwards.

Any ideas or good references to track this down? (much appreciated)