Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect old .aspx urls to .php in iis?? 1

Status
Not open for further replies.

dwest100

Technical User
Aug 9, 2003
59
US
Hi,
I've redesigned my blog using WordPress which I'm running on a win2k advanced server. The blog was running as .net with .aspx extensions for all the pages. It is now running under PHP.

I have a bunch of pages indexed in the search engines as
When someone clicks on one of these pages, I want to have them taken to instead. No particular page, just the home domain.

How can I set this up in iis?

Thanks!
 
The easiest way would be to setup a custom 404 page that redirects to the root of the domain. This can be done via the Site Properties in the IIS admin.

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005) / MCITP Database Administrator (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Hi,
Tried that but it doesn't work for some reason. The server still displays the "Server Error in '/' Application." message with the 404 error following on the same page.

I assume that implies I would need to put the custom error page on the root website??

But, I run a bunch of different sites on iis. I can't redirect errors from all of them to just one of the domains. Tht wouldn't work.

I need to redirect only a specific site's old .aspx urls to the domain of that site.

Any help would be appreciated.
 
Thanks for the assist but something is askew aside from your solution.
Have a look at this link and you'll see the resulting page from my server:


The link is as it is listed in google.

I want to redirect to:

I've taken your code from your link and created an asp page for the 404 error and assigned it as type File C:\WebSites\Site_IdleMinutes\404error.asp under the custom errors tab for the site.

I still get the same error page though.

Where am I missing the boat??

Thanks!
 
Thanks again, but this is a .net server error. I have your page configured correctly now and if I type in the domain and a non-existent page with a .asp extension, I get your 404 error page.

However, if I type in the domain and a non-existent page with a .aspx extension, I get the afore mentioned error page.

How do I make this work for aspx extensions???

Almost there I think...I'm just clueless unfortunately :)
 
for .net you need to set custom errors in the web.config

Code:
<configuration>

   <system.web>

      <compilation debug="false" />
      <sessionState timeout="30" />
      <customErrors mode="RemoteOnly" defaultRedirect="/404.asp">
         <error statusCode="404" redirect="/404.asp" />
         <error statusCode="500" redirect="/500.asp" />
      </customErrors>

   </system.web>

</configuration>
the 500 error is simply optional.
Hopefully the above code is correct, haven't got around to .net as yet.



Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
Thanks! That set me on the right path.
Ironically, while researching this today, I determined that Google has already reindexed the entire blog and none of my .aspx pages are listed now!
So, turns out I don't even need to worry with this.
But I've learned something just the same :)
Thanks much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top