replace ip address with domain name in redirect - url-rewriting

I have a Windows Server 2008 R2 virtual machine with IIS 7.5 hosting a ASP.NET MVC4 website. The WinServer has a public ip address. I also purchased a domain name. The domain name hosting company forwards requests to my server.
For example, when a customer types www.mycompany.com, the request is redirected to 217.151.XXX.XXX which is my server's public ip address.
When the customer is redirected to my server, everything is working. He sees a homepage in the web browser and with address www.mycompany.com in browser's address bar. However, when he browses through different pages in the websites and got redirected, the browser's address bar displays 217.151.xxx.xxx/order/detail instead of www.mycompany.com/order/detail.
I tired IIS url rewrite which rewrites 217.151.xxx.xxx/order/detail to www.mycompany.com/order/detail
But that results in the browser freezing, waiting for a response. My guess is that when IIS rewrites the url to www.mycompany.com/order/detail, it sends a request back to the domain name hosting company. The company interprets the request and redirects it back to 217.151.xxx.xxx which causes a infinite loop.
How can I have the domain name always displayed in the borwser's bar?

A very general issue when we map domain with IP
Check this out.
http://help.lockergnome.com/windows2/Domain-static-IP-mapping--ftopict485575.html

Related

How to point a domain name to specific subdomain on Windows Server

I have purchased a domain name (https://example.com) from namecheap. I have a subdomain (https://subdomain.go.com:444) running on specific port on windows web server. If someone visits (https://example.com), I would like him to land on my subdomain (https://subdomain.go.com:444). How can I achieve this?
I have tried URL redirect record in DNS settings on namecheap but that did not work.
Type : URL Redirect Record
Host : #
Value : https://subdomain.go.com:444
I also want the address to show as example.com instead of https://subdomain.go.com:444 in my browser(masking).
*** ref:- https://www.namecheap.com/support/knowledgebase/article.aspx/9678/2237/how-to-redirect-subdomain-to-a-certain-ip-address-along-with-a-port/

Sharing link from mobile browser shows ip instead of domain name

I have a domain, ‘example.com’ and when I share some of its web pages via a mobile browser (only in Safari and chrome app) to social media, the URL is displayed as an IP ex(http://31.08.94.4:99999) instead of my domain name.
I'm working in laravel framework.
For a clear understanding, I updated screenshot below,
This is the screenshot of what happens when I share from my mobile:
http://prnt.sc/nkxfj5
And this is what happens when the proxy IP is shared instead of the actual domain name:
http://prnt.sc/nkxg8f
I got an solution for this issue,
canonical url of site is used while sharing the site.
So check your canonical url set in your site using,
document.querySelector('link[rel=canonical]');
This could be something on your webserver side. Are you using Apache? In that case check your virtualhost settings to make sure no direct access is even possible and it's set to your domain. For Nginx I'm not sure. Did you also check your DNS settings?

Website redirect setting for https:// prefixed naked domain

I have a site registered on Google Domains and deployed on an Azure VM, HTTPS enforced via the IIS webconfig file. It all works fine, except for 1 piece:
https://mywebsite.com results in "this page cannot be displayed, mywebsite.com unexpectedly closed the connection."
https://www.mywebsite.com works fine, as does the unsecure naked domain redirect (http://mywebsite.com; it redirects to the https://www prefixed link, I have set this up this Permanent redirect in Google domains).
Given the above, what setting (on my Azure VM SSL binding, or Google Domains, more likely) could I change to make sure if someone types in https://mywebsite.com, they will reach it?
Thanks!
Do you have a binding listening on port 443 to mywebsite.com? This should solve the issue.
cheers

RoR 3 - Registering domains for my clients

I am building a RoR3 site that generates a microsite for each client. At this moment they enter to their microsite using the url www.site.com/clientid , but I want to register their own domain programatically, so they will enter to www.clientid.com and they will be redirected to my server. Is there any way to do that?
Have the client point the domain to your IP using the DNS management interface of the registrar. (More technically this would result in the creation of an A record or an AAAA record but this is not your concern).
Once the DNS is propagated, entering www.clientid.com in the browser will make a request to your server (your rails app). There you can selectively serve content based on the domain.
class ApplicationController
before_filter do
#current_account = Account.find_by_domain(request.domain)
end
end

Windows Live Id OAuth with development environment in c#.net

I have just trying to make one sample application, by which I can login in to my website by Windows Live Id OAuth Protocol.
My application (Downloaded one sample available on net) is working fine. It opens the popup where i can supply my credential for windows live Id and then redirect back on the Redirection URL supplied in my account.
I noticed that when i supply live URL (lets say..... myappp.sample.com) it is redirect perfectly. But when i try to put (http://localhost:52254/WebSite9/default.aspx) this is not supported in my account.
(error -> You must enter a valid domain that begins with http:// or https:// - query strings are not allowed. Length is limited to 248 characters.)
My question is that, How can i use to test the whole thing in my local environment. Because it is not redirect back on localhost URL. Only redirection to Live URL.
Is there a way by which I can test the Live Id OAuth with development environment??
East cake. Put in something like:
http://www.anydomain.com/ in the live app page.
Then add that domain to the host file of your machine (or intranet dns or whatever) pointing to 127.0.0.1.
The redirection is just a 302 redirect that happens in the browser.

Resources