Forum Moderators: phranque

Message Too Old, No Replies

Redirecting from old pages (again)

Best way to redirect on a commercial IIS host?

         

JayCee

11:27 pm on Sep 18, 2002 (gmt 0)

10+ Year Member



Been cruising the old redirect topics through 'search' and can't quite find a solution.

The site in question is on a commercial Win2k/IIS 5 server (not under my server admin control) and I want some old pages to redirect to new replacement pages with different names and content, without losing SE rank, or causing errors for people's bookmarks and via a 301 - so they will eventually be removed from the SEs.

Looked as if ASP code above the <head>, like:
<%@ Language=VBScript %>
<%Option Explicit%>
<%
Response.Status = "301 Permanent Redirect"
Response.Redirect "http://www.mysite.com/newpage.asp"
Response.End
'%>

Was the answer, until I realized that to do this server-side meant renaming the old pages from *.html to *.asp (duhhh...) ...which would break all the old links to them ...which defeats the whole purpose...

XOC's cool IIS 404 handler looked good too, but requires access to the server admin.

.htaccess is also out, on an IIS server. I would rather not use JS and sure don't want a meta tag refresh! So, what's left?

Doesn't every webmaster have to deal with redirecting from obsolete pages without bad SE consequences? There must be a real common fix? right? right? [note of desparation creeping in]

Please tell me I'm missing something simple here.

Also, I don't suppose I could do this client-side by just including the above VBScript (inside LANGUAGE tags, of course) in the body of the HTML page?

onlineleben

7:23 am on Sep 19, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you have PHP installed and .htm /.html files interpreted as php files, then you can forward using the header location command in php.
Correct syntax can be found at [php.net...]
(hope posting this URL is not against forum rules)

Anyway, above workaround works like a charm. Try it.

sun818

7:00 pm on Sep 19, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hey JayCee, nice to know someone else here uses IIS for a host. :) I read a Webmaster World thread yesterday but for the life of me can not find it again! After an exhaustive search, I found the author's web site, but not the actual WW thread by Tony Welsh. The script you want is called Smart 404 Handler [evolvedcode.net]. Ask your web host to point to this .asp as your custom 404 page. You benefit by being redirected whether it is an .html or .asp page.

Starting from line 156, you edit the code.asp file as necessary. TEMP will be a 302 redirect. PERM will be a 301 redirect.

'Populate the redirections as required
ReDirect_Add "/bob", "/rita/", "TEMP", sReDir 'If source page was "/bob" then temporary redirect to "/rita"
ReDirect_Add "/sue", "/dave/", "PERM", sReDir 'If source page was "/sue" then permanent redirect to "/dave"

I checked the Server Header [searchengineworld.com] and it returned the 301 I was expecting on one of my permanent redirect requests.

JayCee

1:39 am on Sep 20, 2002 (gmt 0)

10+ Year Member



Thanks guyz!

Really good info!
Since I'm more experienced with ASP, I'll try that route first.
My own hosting service offers custom 404s. Now if my client's service also does, then I'm all set.

Really impressive how many posts WebmasterWorld gets per day nowadays too whew!

I'll report back after I've tried this stuff out, so as to add my results to the searchable knowledge here.

Thanks again...