URL Routing show widgets.appharbor.com as widgets.com - url

Possibly a very silly question... I just don't know.
Assuming I have published a web application to Azure or AppHarbor, URL for the web app would be something like
http://widgets.appharbor.com
Assuming I own the following domain name:
http://www.widgets.com
How do I get www.widgets.com to display the application hosted at http://widgets.appharbor.com without using an iframe?
Furthermore, I don't want links within my application to be displayed as widgets.appharbor.com/stuff, they need to be displayed as widgets.com/stuff.

If you use a Cloud Service or a Website in Shared Website Mode you can use a CNAME to point www.widgets.com to widgets.azurewebsites.net. I don't know how this works with appharbor, I assume they also support CNAMEs.
Update: Looks like AppHarbor also supports CNAMEs http://support.appharbor.com/discussions/problems/1079-custom-domain-names

Related

My website shows hostname url instead of domain name url

i have hosted my website in openshift cloud platform and i have got my domain from godaddy domain seller, after i have hosted my application, my domain name redirects to my hosting url
let us say i have domain name as
www.yellowbox.com
and i have my cloud hosted url as
yellowbox-boxsoft.rhcloud.com
godaddy.com redirects to my cloud host when i hit www.yellowbox.com , but i see problems where i have href links which show my cloud url
yellowbox-boxsoft.rhcloud.com/addUser.html
and this really bothers me, i would like to have my domain url instead of hosting url as below
www.yellowbox.com/addUser.html
i am new to cloud hosting and domain related topic, need some direction
There are a couple of things that could be going on:
1.) You could be using domain masking at godaddy and not have things setup correctly for openshift. Basically it is loading your open shift gear in a somewhat of an iframe on the page, so as far as your open shift page is concerned, it is still being visited at your app-domain.rhcloud.com address
2.) you are generating your links as FQDN links instead of relative links, and using your application url in them. use relative links instead (like /addUser.html)
You should be setting up your www.example.com as a cname record that points to your app-domain.rhcloud.com address, and then things should work just fine.

Problems with MVC4 & External Login with Google

I've an ASP .NET MVC4 application that uses SimpleMembership and allows users to sign in with their google accounts.
In order to do that I configured the application's AuthConfig class by uncommenting the OAuthWebSecurity.RegisterGoogleClient(); line to add google as an external login method. I didn't really change much inside the external login methods that already come with the ASP .NET MVC4 Internet Application template.
Problem:
Everything works fine when I run it locally (IIS express) or when I deploy it to a 'test' server (IIS 6.1, accessible on the intranet only). When I click my "sign in with google" button, I'm sent to google's authentication page, whose url looks something like this:
https://accounts.google.com/ServiceLogin?service=lso&passive=12096...(long url)
Alas, when I deploy it to the 'production' server (internet facing) and try to access it via internet, Google authentication stops working: when I click my "sign in with google" I'm being sent to an url that looks like this:
http://MY_APPLICATION_NAME.MY_DOMAIN.com/accounts/o8/ud?openid.claimed_id=http%3A%2F%2Fspecs.openid...(long url)
This url is wrong not only because it has my domain in it (I believe it should be accounts.google.com?), but also because the rest of it is completely different from the url I get when the authentication works.
What I know and have tried:
If I use fiddler, I can see that the application is behaving differently when I'm accessing the application via internet or intranet.
If I access it from within the network, I see I'm making a request to http://MY_APPLICATION_NAME.MY_DOMAIN.com/account/ExternalLogin?returnUrl= and then "Tunnel to www.google.com:443, Tunnel to accounts.google.com:443". This works ok.
If I access it from the internet I see I'm making a request to http://MY_APPLICATION_NAME.MY_DOMAIN.com/account/ExternalLogin?returnUrl= and then another one to http://MY_APPLICATION_NAME.MY_DOMAIN.com/accounts/o8/ud?openid.claimed_id=http%3A%2F%2Fspecs.openid...(long url). This obviously gives a 404.
I might be wrong but I assume that this url is generated by the OAuthWebSecurity.RequestAuthentication(provider, returnUrl). What puzzles me is that it looks like it is requesting the authenticaton to my server instead of accounts.google.com.
My research so far has only brought to me posts/questions/etc. showing how easy it is to use SimpleMembership for external authentication and I can see everyone does it pretty much the same way.
Conclusion:
I believe this probably has something to do with something I must configure on web.config or IIS. I do know that the requests to my application arrive at my DNS server which does a url rewrite and forwards the request to my web server, although I don't know if this is related to the problem.
Does anyone have any idea of what might be wrong or ever had a similar issue? Any help would be appreciated.
EDIT:
I've looked into OpenAuthSecurityManager.cs's source code and although I can't debug it I see the problem might be related to an incorrect HttpContext inside the RequestAuthentication method, due to my reverse proxy settings on IIS?
I ended up with a request to change the IT infrastructure.
OpenAuthSecurityManager.cs was probably getting a wrong HttpContext instance because of the way the requests were being handled by the previous infrastructure (requests arrived at our DNS server and were forwarded to the web service, on a different server inside our network, with UrlRerwrite rules).
It's working now.

Can IIS or asp.net/mvc somehow achieve this?

There was some coding error recently, and the site was down for a couple of hours during working hour.
Our site is basically a publishing site, user can upload some excels and we grab information and generate some pdfs.
The final pdf location is something like
https://SomeUrl.url.com/Documents/ClientName/DocumentName.pdf
Documents is the controller and we map it to some action and ClientName and document name are the parameters.
What the client want is that even if the site is down (means they can't upload or modify anything), they want the above url to be still up.
Other than rewriting the whole logic, is there something we can do in IIS level?
I thought about url rewriting or url redirect, but don't really think it is possible.
Anyone got any ideas?
Many Thanks
URL Rewrite IIS Extension won't be helpful as it's based on URL pattern. It doesn't care about whether the site is up or down.
You should consider setting up a load balancer instead. It's its job to decide which server to hit depending on server current load or if it's available or not.

using \\servername\sharename in IE9 not being picked up as intranet site

I have a very basic intranet site for our company, and it's main purpose is to link to SMB shares on our network, so people can open files and edit them, without the need to then reupload to the site.
What I have, is a basic < a href="\IP ADDRESS\SHARENAME\">< /a>
The issue seems to be, regardless of whether I use the IP address, or the actual DNS name of the machine, IE9 always seems to think the intranet is an internet site, and stops these links from working.
Let's say for example, the web server address is 10.1.3.81, and I have a share on that same server for a global phone directory spreadsheet. I want someone to be able to click on the link on the page, and have it open that file directly.
So for the href, I put in \\10.1.3.81\intranet\phone directory\list.xls
Or something like that. IE9 (which is what all our users are using), considers this link to point to file://10.1.3.81/intranet/phone directory/list.xls
That's great, but as it doesnt consider this to be on the intranet, it blocks the file:// protocol, and the link does nothing.
If I add the site to my trusted sites list, it then works correctly. So I am wondering if there is a way on the programming side of things, that will let me create these kind of links and have them auto picked up as an intranet link?
Failing that, I will post on serverfault, and see if someone can guide me on applying a policy to add this site to trusted sites for all users and computers.
Many thanks
Eds
As it turns out, I was accessing the intranet by using either the FQDN or the IP address of the server.
As this article shows, http://support.microsoft.com/kb/303650 , if I just use the server name instead, and drop the domain name from the end, the links behave as I would like.
Sorry for this useless question.
Thanks, Eds

Accessing a share point site using the object model

I am trying to access a share point site using the SP object model from a console application.
I am trying to do something like this..
SPSite site = new SPSite(sitePath)
//Operations go here
This works fine when the share point site and the console app are on the same machine.
However when the console app and the site are on different machines, I get an error "The Web application at "http://server/url" could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application"
Here are the things that I have already done:
1) I have tried accessing the site via both IP address as well as machine name, assuming that it could be a DNS resolution issue.
2) Initially I impersonated using a farm admin account, still i could not access. Then I added myself as the farm admin, still no joy.
4) The site is accessible via IE. So it is not a permission issue I guess.
5) I have tried almost all the solutions suggested by various links obtained by googling the error message.
I am trying this on share point 2010. A similar issue occurs on 2007 also. Sometimes its kind of frustrating to do SharePoint development , since I get the feeling of stumbling from one error to the next, with no clue as to what could be wrong and the error messages not being helpful in the least :(
That is true because you can't run server object model on another machine. You can use client object model

Resources