views:

41

answers:

2

I have converted a php to asp.net mvc and have it hosted with the Rackspace cloud. All works great apart from some php links are still linked from other sites and within search engines. My question is what do I need to add to my web.config to force php sites to go through the .net engine?

These links work as expected as I can catch the 404 and redirect where need be:-

http://www.securahome.net/myjunk.info

http://www.securahome.net/myjunk.phpp

However this one doesn't:-

http://www.securahome.net/myjunk.php

I have spoken to Rackspace cloud and they say "its not possible as IIS doesn't recognize php files. You can setup mime types to handle them"

This however makes no sense and I think they did not understand the problem. Does anyone have a solution?

A: 

You can use the IIS url rewriting module for this:

http://learn.iis.net/page.aspx/461/creating-rewrite-rules-for-the-url-rewrite-module/ http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/

Raj Kaimal
No the problem is that it seems that PHP is getting hit before IIS, so even a rewrite will not work. I cant use .htaccess either.
Rippo
+1  A: 

After an hour with the Rackspace Cloud support team we finally got an answer. They allowed me to use a .htaccess file so I could do a site wide redirect on an php file. Not ideal but it got somewhere where I needed to get to.

Thanks for your input

Rippo