I am looking for a way to provide configurable keyword-based URL redirection for users on an intranet (within a company), so that entering a URL of the form "go/ would redirect to an pre-defined URL associated with that keyword. For example, "go/accounting" might redirect to "http://company.com/accounting". The destination URL could be any valid URL either internal or external to the company. If there is no existing keyword defined, the browser should present a page where a new URL could be associated with that keyword. I used to work at a company that had something like this implemented, and it was very useful.
Host file should be a perfect solution for you.
When you are browsing the internet and writing a name in the url(e.g. facebook.com) the computer need to translte this name you wrote to an ip address.
Host file is a file that the system will use first when trying to translate name to ip, if you will add a line to the host file like this:
0.0.0.0 Www.facebook.com
Every time you will try to browse to facebook it will direct you to the ip 0.0.0.0.
So for your question you should add a line like this:
<your company web ip>
The host file is located in: c:\windows\system32\drivers\etc
Related
i am very confused about the whole domain vs hostname thing. I tried googling, but the answers are too confusing for me, so i wanted to create a question using a specific example known to most people.
So lets take as an example atlassian's products. The url is atlassian.net.
If i wanted to create my project on atlassian, url would look like myproject.atlassian.net. My customer potentially wants a similar system for his website, so i need to know how to validate names of subprojects.
So, is myproject a subdomain or a host?
What are naming rules, e.g. can i use underscores/dots in that part of url?
How does routing work for such urls? Dns resolves the top url atlassian.net and then server logic serves pages for specific subproject?
Thanks.
In most common case Hostname (e.g. localhost) is usually parameter used for internal program reference and domain name is used for external / internet reference. How domain resolve to hostname can't be summarized easily. You may see many places where both by fault were used as synonyms and so based on context you need to figure out the purpose.
Your example is not correct in context of JIRA.
"mycompany.atlassian.net" is actually your company account it might have multiple projects within it issues that are within the project got URLs like "mycompany.atlassian.net/browse/STAC-20" where STAC is the project key
It terms of how domain/sub-domain name works. There are different level of configurations and a good start for you probably might be this link:
https://uk.godaddy.com/help/what-is-a-subdomain-296
Here is short explanation in case you are referencing "Name server" hosts:
Each domain once configured needs 2-3 name servers that will know how to resolve all its subdomains, aliases usually these are provided by hosting company where we are placing our domain.
So if "mydomain.com" might be configured with "ns1.anyhosting.com", "ns2.anyhosting.com" to serve "mydomain.com" dns requests.
In case you are the one that wants to to host "name server". It is possible by configuring "Hosts" at domain registration that have explicit IPs e.g. "ns1.mydomain.com" , "ns2.mydomain.com" and these are referred as Hosts.
This is the exact word from my textbook:
Demonstrate by giving an example:
What is the hostname of the following URL?
http://www.weather.com/summer/temperatures.html
solution: www.weather.com
Reason:
The hostname is the complete domain name, which is the characters after the scheme and
before the path.
Some other definitions:
Scheme - Characters at the beginning of a URL followed by a colon ":" or a colon and double slashes "://". Common URL schemes include http, https, mailto, and file. Ex: In http://www.cdc.gov/alcohol, the scheme is "http".
Hostname - The complete domain name specified in the URL. Ex: In http://www.cdc.gov/alcohol, the hostname is "www.cdc.gov".
Path - All characters to the right of the hostname in the URL. Ex: In http://www.cdc.gov/alcohol, the path is "/alcohol".
I'm trying to figure out whether a website I use was hacked.
When I access the site via www.site-name.com, I'm taken to the website.
However, when I access the site without the "www," i.e. site-name.com, I'm taken to a different website.
Why is this happening? I did a little research and my only guess is that someone changed the site's .htaccess file, but that seems unlikely, as the different website has no relation to the official site.
Can someone help me understand what's going on here?
One IP address can host multiple websites with different hostnames using Virtual Name Hosting.
The HTTP server will look at the Host header in the request to determine what site to use for a given request.
This lets you have one IP address serving example.com and example.net.
Typically, the first Virtual Name Host will be the default, so if you were to ask for example.org the server would not recognise it and give you example.com instead.
In this case, it appears that the server has a Virtual Name Host configured for www.site-name.com but not for site-name.com so requests for site-name.com get the default site for the server.
I understand that if I want customers to be able to use a custom domain that points to their space at customer.mysaasapp.com, they must define a CNAME record that aliases the canonical customer.mysaasapp.com domain.
What I don't understand is how this alias persists across requests. For example, if the customer site links to its resources, how does it know whether to link to the customer.mysaasapp.com/videos domain vs the customclientdomain.com/videos resource? I don't want the true subdomain to show up in the navigation bar as soon as a link is clicked. How is this handled?
Let me try to explain it for you. As you already know CNAME are canonical names for another domain.
As you know when we hit a domain in browser address bar. Browser asks the DNS (domain name server) where to send the request. DNS matches the domain name and sends the IP address back to browser and browser hit those IP address to get the response.
But when we want multiple sites to be served from same IP address which is the case in SAAS app. We can define CNAME for each client. Which is alternative to IP mapping.
So when browser asks the DNS about the address for the provided host url. DNS sends back the actual domain name/path and tell's the browser that it's the right address to ask.
So now browser sends the request to actual domain behind the scene and sets the HOST header to the provided address which user entered. (customclientdomain.com/videos for your case).
Now the server knows which host was provided by the user and responds accordingly.
From next request onward Browser does the magic and give you a mimic that it's a totally new website.
All of the modern browser including WGET , CURL also handles this.
Here is a link with more details.
Currently, my .NET MVC application hosted on IIS 7 can be accessed remotely with the following url:
http://172.21.1.83:8080/Mysite/Index
I want to be able to use the url
http://example.com/Mysite/Index instead.
How do I achieve this? Basically I just want to get rid of the ip address and port number in the url, and replace it with a custom domain name (like example.com).
Sounds like you need a reverse proxy. That way the user doesn't have to see or use the port. Check out this article.
http://www.myconnectionserver.com/support/tutorials/v90/iisProxy/index.html
In your IIS web application click on Bidings from the right side menu bar, and add a new biding by entering your IP address and Port number, and your Host Name as the domain name which in your example is http://example.com/Mysite/Index.
I want to do capture subdomain as a parameter and show the appropriate information based on subdomain.
for example user1.domain.com and user2.domai.com each one get appropriate info.
possible duplicate: Is it possible to make an ASP.NET MVC route based on a subdomain?
what i have done so far:
I have a dns server with following ip address: 192.168.1.11 and a web server which host bunch of websites with ip 192.168.1.12
The site the should capture the subdomain is named pakdomain.dev
I've tried two scenarios:
after defining pakdomain.dev zone on iis and creating and "A" record with www as host and ip 192.168.1.12 on dns server
fist i have created another "A" record with "*" as host and wildcarding it to ip webserver
second i have created another "CNAME" record with "*" as host and wildcarding it to www.pakdomain.dev
in iss i have a binding with www.pakdomain.dev and pakdomain.dev to a website.
none of the above scenarios have worked for me when i goto www.pakdomain.dev or pakdomain.dev everything is fine but when i try to go to address like user1.pakdomain.dev or user2.pakdomain.dev the it goes to default website on iis.
what should id ? and how should i capture subdomain on my app?
Try this
var domain = HttpContext.Current.Request.ServerVariables["HTTP_HOST"];
That should give you the host header information and then use the value to route to wherever it is you want to go.