URL redirect when accessing domain - iis

is the first time I'm using IIS (Windows Server 2019) and I'm looking for a configuration to be able to redirect clients from http://mysiteExample.org/ to http://mysiteExample.org/embed.html?key=val. I considered that URL Rewrite Module could help me to achieve this (as is not necessary for the clients to see the new URL they'll be redirected to). I made the configuration as shown in this screenshot, where I set '^$' as a pattern to specify this should apply for cases where no URL string is provided.
Could somebody with more experience advise me on how to achieve what specified above?
Thanks in advance

I finally managed to make it work changing the action type from 'Rewrite' to 'Redirect'.

Related

URL and Port redirect on IIS

I'm struggling with an issue in IIS 8.5 which is about redirection and rewriting, but couldn't get a solution yet
we have an application driven Webpage running on IIS, but is not manageable.
This application can attached by browser using
http:// 10.172.100.242:81/appname/object?parameter
which is not really customer friendly. Up to the "?parameter" the URL is steady, parameter is changing.
I would prefer to have this url shown to the customer as
http:// appname.domain.com/parameter (best solution) or
http:// appname.domain.com/object?parameter
The combination of redirect and rewrite is too much for my knowledge
The rules I tried didn't work and now I have the hope to get some help from guys with better knowledge than mine...
Thanks in advance
First create a new website in IIS. Then configure as follows.
Inside the website create a folder called "parameter"
Select the "parameter" folder and set the redirect as show in the picture 2

.htaccess redirection keeping my orginal URL

I would like to have the following setup using .htaccess.
domain.com/test/hello.php or domain.com/index.php or any other link must show only domain.com in the URL.
Kindly share your views on this.
As implied by Jon Lin, this is not directly possible as the server cannot guess what content should be loaded. The simple rule of HTTP is that each request has its own response.
Furthermore, it should be noted that, if it were possible (by some kind of magic - perhaps by the use of AJAX), it wouldn't be good for SEO, as Google/Bing/whatever wouldn't be able to index your site.
If you really wanted to mimic the behaviour, you could run the following HTML5 History API method in JavaScript:
window.history.pushState("", document.title, "/");
This will change the address bar to show only your domain name, and will more than likely have side-effects.

Redirecting to another site by masking url

I want to redirect all the users who enters www.siteA.com/folder1 to www.siteB.com/folder. But user should see www.siteA.com/folder1 in address bas even after redirection to www.siteB.com.
I do not know how to do it with .htaccess Can somebody please help me how to mask the url. I really need your help.
Thanks
You can "Force the substitution URL to be internally sent as a proxy request" via the P flag.
RewriteRule ^folder1(.*) http://www.siteB.com/folder$1 [P]
There are some other examples in the documentation of the RewriteRule.
If this does not work (e.g. no access to the server configuration and the proxy module is disabled) you are probably best of using a Proxy script like PHProxy.
On a second look I think PHProxy is not really what you need. Maybe give this one a try: http://code.google.com/p/php-proxy/ - The installation instructions look pretty simple.
You want to use proxying . On Apache, mod_proxy should do what you are looking for.
Bear in mind that your server will eat up twice the amount of bandwidth. Once to get the data from the source server and again to send it to the client.

Get rid the slash in URL (ex. something.com/dogs)

I recently purchased the domain name simply.do. I want to use it as a URL shortening service, but I don't like have to do simply.do/something. Can I remove the slash or replace it with a difference symbol?
If this helps, I am using a server running Nginx and I will not switch to Apache.
Thanks!
I would also appreciate any feedback on the domain name. I was hoping to sell simply.do/insurance, simply.do/religion, etc. to various companies. Do you think there is a way I could sell these parts on an auction website? Thanks!
When you visit simply.do, that refers to simply.do/index.php (if you use php in background).
So, you can use it as query, for eg, simply.do?insurance will lead to some long url like ://a-long-domain-name/a-long-list-of-directories.
Use server script to get the value after ? mark so that if someone visite simply.do?insurance, it will be like simply.do/index.php?insurance. It works with all browsers.
You can obtain the value from the $_SERVER['REQUEST_URI'] OR $_GET[] array, check if the query string: 'insurance' is in your db or not. If yes, redirect the user to required site.
You need to know how the HTTP protocol works here, to better understand what you are doing. If you want to sell the URLs, you need a basic URI handler for /insurance, or /religion. You can also sell insurance.simply.do, If you want to, thru' DNSes and default VirtualHost handlers.
This answer is irrespective of the server used.
You cannot remove/replace the / right after simply.do since it delimits the host and the path in the URI.

Dynamically creating URLs for other websites

I'd like to know how websites have created URLs with other domains like these on trafficestimate.com.
I'm guessing it's some .htaccess stuff to redirect domain names to a dynamic page?
Thanks
Your URL has an GET Request. So when someone calls the page http://google.com/search with the parameters hl=en, safe=off etc., the page can process those parameters. So for instance safe=off means that you want to get back any search result. The q=site:... is your search string. In this case Google will look it up in its database and give you the results. So when you call this URL there is probably no .htaccess processing done. However you can process the URL and GET request with .htacces and i.e. redirect the user to another page.
Maybe you'll describe a bit further what exactly you trying to do/want to know. This makes explaining easier.
EDIT: After reading Gumbo's comment I looked at the Google result page. So maybe your question means the trafficestimate-URLs. They look like http://trafficestimate.com/example.org. This is really a good case for .htaccess. So using .htaccess they take the URL and redirect it to http://www.trafficestimate.com/websites/?domain=example.org. Here you have again a GET request and an application builds the page.
Some URL rewriting is probably involved. Otherwise they would have to create an existing file for every possible request.
Using Apache’s mod_rewrite in a .htaccess file is one option. But since the server identifies itself with “Microsoft-IIS/7.5”, they are probably rather using ISAPI_Rewrite, a mod_rewrite derivative for Microsoft’s IIS.

Resources