IIS Permanent Redirects - iis

I have seen a few things written about this and remember one where there was an XML file. So, there is an old URL and a new URL. If the user hits the old URL he is redirected to the new one.
The redirects can be from files that don't exist on the server eg new-jobs.php from Apache server has been moved to an IIS Server and the file is now called new-jobs.aspx.
Does anyone know of such a system or have a better solution?

Check out URLRewrite.

Related

DNS redirect of a url to another url

We are currently looking at identifying the best approach to carry out a redirection of a url folder to another url folder o a separate domain. We have tried a few options but have been unable to make this work. Any other redirection options such as apache, html etc are not possible. This url is only accessed through the browser by an application to download some files. This application cannot be changed but needs to download these files from another location.
Hence, we need to redirect the following:
https://sub1.domain1.com/xyz
to
https://sub2.domain2.com/abc/xyz
Any ideas how we can achieve this?
Note: we have full control of DNS of the domain1 and there are no plans to use this domain.
You can't do that with DNS alone. The DNS never sees the "path" part of the URL. You need a webserver aware of the situation who can provide a 302 redirect.

IIS keep some urls when changing domain

I will be changing a www server to be ww2. Making a new server the www server. The new server has IIS 8.5 running, with https, ASP.Net/MVC. The old server does not have https.
I have some urls that users may have bookmarked to the old www. I would like those urls to still work (doesn't matter if the browser displays ww2). I have made sure those urls are unique and don't conflict with any resource/path on the new server. Some urls are a resource like .html others are any in a path. Do I put all of those urls in as redirects in IIS on my new server? Are redirects the best of accomplishing this?
I think what you're looking for is the URL_REWRITE Extension.
You can download it here: https://www.iis.net/downloads/microsoft/url-rewrite
Then apply the rewrite rules at the server level not the application level. This will allow you to easily control the the flow of any your old URLs to your new location.
Depending on how many you have theirs a few different ways you can do it with URL_Rewrite.
To get you started here's a bunch of tutorials on how to use it: https://www.iis.net/learn/extensions/url-rewrite-module
After you play with it and if have any specific questions, just ask on stackoverflow and tag the question with URL-REWRITE-MODULE

How to Stop Old invalid links/bookmarks hitting the new website?

I have a heavy traffic website, where i recently upgraded the whole website to new system, where most old urls are now not valid and causing problems in the new system. Most of the old urls are saved in the users browsing history.
How do i make sure these old links/bookmarks are redirected to the main page of the new website
please note i am using nginx and its not possible to redirect by one by one as website is large and not possible to do them manually.
Any ideas ?
I think the simplest solution would be to add the following in your Nginx server block...
error_page 404 /;

Point IIS8 virtual directory to a different server IP Address?

Here is my issue (keep in mind I am used to linux not windows servers): I have a website domain.com (.asp site) that is hosted on an IIS8 server and then a folder domain.com/folder that needs to point to a different servers IP address that holds a different site (linux server running Magento).
I know personally that a subdomain should have been created and DNS pointed to it correctly like folder.domain.com but I have inherited this issue and am trying to see if a solution is even possible.
Thank you all in advance.
I dont have previlage to comment in your question.! So I commenting here.!
Have you ever crossed symlinks? I hope you need the following link. The question is not clear though.
check this out.
Symlink created with mklink not working with IIS7.5 -- Windows 7
Responding as another team member on this project--
A 301 redirect is not a viable option by nature of Magento's URL request mechanism (if the request didn't originate from the URI set in the config, then redirect to it). We either end up with infinite loops, or IIS rewriting headers to trick Magento in to thinking the request URI is correct and performing a 301 redirect on every resource on the page (and the page itself, of course). This breaks miserably on POST requests.
We must be serving fully-qualified URLs from domain.com/folder/foo-bar.baz.
Switching to Linux is not possible. Please don't suggest what we already want.
Thanks, SO.

How to STOP redirecting my website to mobile.mywebsite.com in smartphones

I have developed a website www.mywebsite.com and it is ready to go live.
I have used Codeigniter framework.
When I enter www.mywebsite.com from any android/iphone, it redirects automatically to mobile.mywebsite.com and displays page not found error. I dont have any mobile site developed for this. I want to show the main site even on the smartphones.
I am not good at .htaccess file, and I am using default .htaccess to remove the index.php in the url.
I tried creating a subdomain mobile.mywebsite.com and pointed to root path. But same response. I search online, but didnt find anything on how to STOP redirecting.
Thanks in advance.
When I was uploading my local files into the server I was NOT overwriting the old ones assuming the folder is clean and no need to overwrite. But my hosting provider has default .htaccess which is redirecting to the mobile site.
I deleted the old one and gave my .htaccess without the mobile redirection and everything is in place now

Resources