Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

301 Redirects from ASPX to PHP files on IIS server

Posted on 2011-03-16
5
Medium Priority
?
527 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 1500 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
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…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

610 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