Solved

301 Redirects from ASPX to PHP files on IIS server

Posted on 2011-03-16
5
508 Views
Last Modified: 2012-05-11
Hello Experts,

I have been tasked with converting an existing ASP.net (.aspx) site running on IIS to a PHP site running on IIS.  I can't use another Web server as there are some back-end items that are still in asp.net.  

My question is this:  What is the best way to do 301 Permanently Moved redirects?  I've read a bunch about using the .htaccess file in Apache, but not sure how to do this in IIS.  Also, the names of the pages are not going to be the same, and we have shrunk the site so many of the old aspx pages will go to the same php file.

Is there a way to do this in one file as in using the .htaccess?  The only other solution I can think of is to maintain all the aspx pages and do a response.redirect in each.  I was hoping to avoid doing that if possible.

Many thanks!

Ike1492
0
Comment
Question by:ike1492
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 15

Accepted Solution

by:
pcsmitpra earned 500 total points
ID: 35149076
Step to 301 Redirection : IIS - website -> properties - > Home Directory -> A redirection to URL -> Mention Destination website name -> Select permanent redirection option -> Apply -> Ok -> Ok .
You are done , To see the step by step with more details please visit : http://www.highposition.net/301-redirect-tutorial-iis/
0
 
LVL 2

Expert Comment

by:DerekStone
ID: 35149099
You'll likely want to create (or find on the Web) an ASP.NET HttpModule that does redirection. The module get's configured in "web.config", and can use regular expressions or an XML file, for example, to do the mappings. Basically the module will "intercept" requests that it can rewrite (to a different URL). Luckily you're going from ASP.NET to PHP, which means the pages people are redirecting from (*.aspx) will still be fed through the ASP.NET pipeline, so this will work in IIS6 as well. IIS7 has an "integrated pipeline", meaning the modules will work regardless of the file extension (i.e. on non-ASP.NET pages).
0
 

Author Comment

by:ike1492
ID: 35150253
pcsmitpra:  I understand that this can be done when one URL is being redirected to another - thanks!  In my case, the URL will remain the same, and individual aspx pages will need to be permanently moved to their php counterpart, and in a one to many fashion.

Ex.  www.xxxx.com/product1.aspx --> www.xxxx.com/product1.php
    & www.xxxx.com/product2.aspx --> www.xxxx.com/product1.php

I hope this helps clarify things.

Many thanks!

Ike1492
0
 
LVL 11

Expert Comment

by:b_levitt
ID: 35151574
If this is IIS6 you should be able to use a wildcard redirect:
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/41c238b2-1188-488f-bf2d-464383b1bb08.mspx?mfr=true

Nearly your exact senario is spelled out in the example for the $0 thru $9 variables.

A more powerful rules engine exists in IIS7 but there is no user interface (you'll need to modify the web.config).  Just above the samples section there is a similar example to what you want to do:
http://www.iis.net/ConfigReference/system.webServer/httpRedirect#006

0
 

Author Closing Comment

by:ike1492
ID: 35724109
not what I was looking for
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How difficult would it be build a cookie scanner in PHP? 21 54
Chrome SSLException for localhost 1 41
How does this modal work? 3 29
Position image fpdf 4 10
This article discusses four methods for overlaying images in a container on a web page
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question