hosting in iis express as a subdomain due to shared cookie - vs gives error you must specify localHOST aS servername - iis-express

We currently a cookie based single sign on solution for multiple sites.
As far as I know to share cookie you have to use a subdomain instead of localhost. Otherwise the browser would ignore it.
However I get an error saying "you must specifiy localhost as your servername" when I try change the project url setting to my subdomain.
It only works if I manually add a entry in the applicationhosts.config.
Whats the eaSIEST way to write a script that will merge other develelopers config with mine?
Or even better is there a way around this limitation

Found a solution.
In visual studio 2013 the only way I can find is to keep the project url as localhost: then set the start url to yoursubdomain.domain.com.
To add site entry to iis express you can run the folllowing as per scott hanselman blog http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx
"c:\Program Files (x86)\IIS Express\appcmd.exe" set site /site.name:MvcApplication18 /+bindings.[protocol='http',bindingInformation='*:80:hanselman-w500']

Related

No backend styling in OctoberCMS after deploying on IIS

I'm having a problem with the backend when I deploy my site to the IIS of my web host, it has no styling. At first I had this problem with my entire site but then I added the IIS configuration code from the documentation to my web.config file in the root map and it fixed the front-end but the backend is still broken. I can still login but there is just no styling, it's a bit difficult to navigate the backend that way ;)
Here is some more info:
PHP version 7.0.19
October system build 419
IIS webserver
This is how my backend login screen look right now
I added some other code snippets that I found on the internet to my web.config file but that didn't solve the problem. Has anyone encountered the same problem? If so, could you tell me what might fix this?
Edit: Chrome Network Tab
To deploying your octobercms to server, you need to change the url parameter in config/app.php file. It's should look like this:
'url' => 'http://yourdomain.com/',
Don't forget it should contain http:// or https:// string.
Hope it helps

xampp - no longer loads local website but always redirects to internet version of site

I have a website that is live and a version that I am working on locally using XAMPP. For some reason every time I try to load:
http://localhost/websitename
or
http://127.0.0.1/websitename
it goes to the internet version. This has only started happening. All services are started. XAMPP is working for all other sites that I am working on locally.
Check your site settings as I believe you're having the url in your website set to the live version.
This can have alot of reasons.
What does your windows host file have for redirect rules (C:/Windows/system32/drivers/etc/host) I assume that you use Windows because you said "xampp", correct me if im wrong)
Check for header(); redirects within your websites php scripts.
Do you have a v-host entry redirecting you to another url in your v-host config of your apache?
Check if you have any hard-coded url's? or redirects? in the project that are redirecting to the live version.

Visual Studio Local IIS Web Server Project Url With Multiple Subdomains

I would like to try testing virtual hosting of an ASP.Net MVC website on my local machine. In Visual Studio in the Web tab of the properties file for the MVC project, I selected Use Local IIS Web Server. By "virtual hosting", what I really mean is that I'm trying to make sure that pages load correctly for urls of the form http://sub-domain-i.my-domain.com/MyMvcProject/Controller/Action, where I'm hoping to test multiple subdomains in place of sub-domain-i. In production, everything will be running under a single IP address on one server. I also hope to test https for urls of this form using a wildcard ssl certificate, but currently I'm having trouble configuring Visual Studio to just test regular http. Prior to worrying about sub-domains, the Project Url field in the Web tab of the properties folder for my MVC project said "http://localhost/MyMvcProject", and everything worked fine. However, after changing this to "http://sub-domain-1.my-domain.com/MyMvcProject" and then adding the following line into my C:\Windows\System32\drivers\etc\hosts file,
127.0.0.1 sub-domain-1.my-domain.com
Visual Studio produces the error "Unable to create the virtual directory. http://sub-domain-1.my-domain.com/MyMvcProject". Does anyone know what I might be doing wrong?
Many thanks in advance!
Edit: I've just discovered that if I select Use Custom Web Server instead of Use Local IIS Web server, it works and I don't get the popup error from Visual Studio. I'm still not sure why this solution works, though, or what I was doing wrong by selecting Use Custom Web Server...
A little late, but I hope it helps somebody.
You need to create the binding in the IIS website prior to add it to the project url of the project. That binding must be like
http | sub-domain-1.my-domain.com | 80 | * or 127.0.0.1
How to create a binding

Routing a url to fetch content from another site

Environment: IIS 7.
I have a default site www.domain.com. Folder C:Inetpub/wwwroot/domain
There is subdomain www.subdomain.domain.com. Folder C:Inetpub/wwwroot/domain/subdomain.
Now, I have set up a new website at an external server, say www.newdomain.com. I cannot host www.newdomain.com on the same IIS server (as mentioned above) due to some constraints.
In this setup, how do I get www.subdomain.domain.com/blog to show all the content available on www.newdomain.com while preserving the URL as www.subdomain.domain.com/blog
How could this be achieved in IIS 7?
You would have to put the entire www.subdomain.domain.com on the other server. You can't put just the /blog path somewhere else.
How would any client know to go to that other server for /blog if the DNS for the subdomain points to the first server?
Alternatively, you could create blog.subdomain.domain.com for the blog server.
Possible approaches:
Host the new website as blog.domain.com with the actual content hosted on a different server (not the same IIS server as domain.com)
Set-up a ProxyPass on subdomain.domain.com/blog to the new website. I know how do to this on Apache (via mod_proxy and ProxyPass), but not sure how to do this with IIS. Probably ARR can help you.
I was finally able to do this by reverse proxy rewrite rule. For those who have similar trouble here is the solution:
Go to the site node hosting www.subdomain.domain.com and click rewrite rule. If ARR is not installed the IIS Manager will ask you to install it. After installing ARR close and reopen the IIS Manager.
Open the rewrite rule window. There will be a dialog asking to allow reverse proxy to servers outside your server farm, accept that. In the Inbound rule enter www.newdomain.com. In the from input of the Outbound rule enter www.newdomain.com and in the to input enter www.subdomain.domain.com. click apply changes.
This will route the entire www.subdomain.domain.com to newdomain.com. What you need is to route only the /blog link.
To do this go to rewrite rules and select the rewrite rule you just created. Click edit and in the match section in url input change (.asterix) to ^blog(.asterix). This will apply the rule to route only the /blog.
That all. test your routing in the browser, if everythings fine this should work.

BlogEngine.NET multiple blogs at virtual directories - error 404

BlogEngine.NET 2.5 supports multiple blogs, as you can see in this post, and it really does, i tested this feature with subdomains - works fine. But i can't get it work with virtual directories.
in the post you can read this:
...you do not need to create physical directories named blog1 and blog2.
These are virtual directories that BE.NET will look for in the URL to
treat that request to the web server as being on behalf of those blog
instances.
I tryed to add ~/en virtual path from "Add new blog" option in Blogengin.NET settings but I got this error:
HTTP Error 404 - File or Directory not found
Are you on IIS6 or IIS7? I tested with IIS7, both integrated mode and classic mode app pools with success. If you're on IIS6, it's possible one of the wildcard settings for the aspnet_isapi.dll need to be turned on (cannot remember offhand what that setting is).
Another thing to look out for is to make sure a physical directory for "en" does not exist.

Resources