asp.net - IIS7 & 301 Redirects - Folder to File -


We are using IIS7 and ASP.NET 3.5.

We have updated our website with new pages. Now, there are many links on the internet given on our website, although many of those links have now been broken due to a change in our directory structure for our new website.

I was redirected to several requests, 301 "new page". Many of the old pages are just like directory URLs:

/ services / software development

/ products / geographic data

/ sitemap

/ Company / Conditions

I have written some code in the Global.assx file to capture URL, parsing them and redirecting them. However, when there is no file reference (.aspx), the URL is not caught by my ASP.NET application.

It seems that, these redirects need to be created in IIS7.

Now, the above URLs are at a directory level (they are not directly requesting an actual .aspx page) ... I send a 'directory' request to another directory by using the virtual directories I can not redirect a directory request to an actual .aspx file

Here are some types of redirects that I need to create:

= =========

Old: / s Voice / Software Development

Redirect to: /services/custom-software-development.aspx

============

Old: / Sitemap

Redirect to: /sitemap.aspx

============

Older: / Company / Terms

Redirect to: /company/termsofuse.aspx

=============

Old: / Company / Career

Redirect to: /company/careers.aspx

=============

Older : / Services /

Redirect to: / services / custom-software- Develop.aspx

=============

Anyone on this Can you put light? Please let me know if you have any questions. Many thanks for your help.

A quick and dirty option is the default in the folder you've listed. Create aspx redirect page. For example, to handle services / software development, create a file default.aspx on /services/softwaredevelopment/default.aspx with the following:

  & lt;% @ page language = "C #" Inheritance = "System.Web.UI.Page"%> & Lt;% Response.Redirect ("/ services / custom-software-development.aspx"); & Gt%;  

This solution is only practical if there are only some redirects, because it does a lot to hide your project with code files, of IIS 7. Better solution of large number of redirects to use


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -