Forum Moderators: open

Message Too Old, No Replies

HTML pages and Permanent Redirects on IIS Server

         

Graham

3:31 pm on Sep 2, 2005 (gmt 0)

10+ Year Member



I have searched and read many posts, but with not being particularly technically minded or a programmer, am struggling to find a solution to the following problem.

I have recently had to move domains, for reasons beyond my control.

The new site resides on a brand new domain/server, with the old domain being used as an alias for three months.

The site is written in HTML and resides on a Windows 2003/ IIS 6 hosted server.

Is there any "easy to follow examples" of how I can redirect all of the old pages (around 280) to the brand new pages (all using exactly the same page/folder names and structure)

The hosting company don't seem to want to set up the redirect for each page (on the server) from the old site (which I think they have now removed the account for anyway), so I am kind of stuck.

I saw some threads mentioning using a 404 Error page, which redirects (301) to the new pages, however I am completely at a loss to understand how this is done.

Any help or pointers to some "dummy" guides would be appreciated.

Thanks

asp4bunnies

5:43 pm on Sep 2, 2005 (gmt 0)

10+ Year Member



It's fairly simple.

First make a new website in IIS with no content at all.

Then, make a blank page in your root directory and name it 404.asp.

In IIS, go to web site > properties > custom errors tab.

Then scroll down to 404 errors and choose to point it to a relative url and type in "/404.asp".

In IIS, go to your real website that's on the original server (i.e. the original server), and change the ip there to something else. Take that IP and put it into the new 404 website you created.

Now you can do your redirecting on that 404 page.

I fon't know your link structure so I can't tell you how to do the manipulation, but the URL you want to manipulate will be in the querystring... so start here:

Place the following on your 404.asp page
<%
response.write request.querystring
%>

Based on that ouput, do some string manipulation to find out what to response.redirect. Hope that helps.

Graham

11:51 am on Sep 5, 2005 (gmt 0)

10+ Year Member



Hi asp4bunnies

Thanks for your response, however where you mention that "it's fairly simple", may be true, but not for myself ;-)

The part about making the 404.asp will be no problem. Currently I have a custom 404 page on the domain, which the hosting company have set up for me.

The current page is a html page, however I can modify this and get them to set up the page as a 404.asp

The rest of your response, unfortunately goes above my head, and I have no idea how to create/add the rest of the solution to the 404 page, or to manipulate the strings to do the response.redirect

Any further advice would be welcome.