Forum Moderators: phranque

Message Too Old, No Replies

So what is the best way of redirecting a page? (shared hosting/IIS)

without running into 302 type issues

         

oddsod

1:57 pm on Jun 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I appreciate that for those with dedicated servers/apache etc there may be a lot of options. My query really relates to a site using shared hosting (IIS) and I don't have IIS admin access. I can't use a .htaccess on this site because of the Frontpage extensions.

I have a whole folder that needs to be removed (with about 40 pages). Several of those pages have PR4s and 5s and I'd rather not lose all that PR. I want people landing on any of those 40 pages to get sent to one new page that I post. Do I just do a meta refresh on each of those 40 htm pages? Any downsides to that?

Any other suggestions?

I hope this is in the right forum.

pageoneresults

2:37 pm on Jun 30, 2005 (gmt 0)

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



My query really relates to a site using shared hosting (IIS) and I don't have IIS admin access. I can't use a .htaccess on this site because of the Frontpage extensions.

Will the host install an ISAPI filter so you can do your own rewrites? All they would need to do is purchase a copy of ISAPI_Rewrite ($69.00 USD) and install the global ini file at the root of the server. Then all sites on that server can have an ini file at their root which can be controlled by the site administrator.

Here is an example of what that file might look like in your above situation...

[ISAPI_Rewrite]

RewriteCond Host: ^example\.com
RewriteRule (.*) http\://www\.example\.com$1 [I,RP]

RewriteRule /dir/old-file.asp http://www.example.com/dir/new-file.asp [I,O,RP,L]

Note: The first rule is a mandatory entry on all of our .ini files. Its a 301 for the sub-domain to the root domain (example.com 301 to www.example.com).

It's really that simple. ;)

I have a whole folder that needs to be removed (with about 40 pages). Several of those pages have PR4s and 5s and I'd rather not lose all that PR. I want people landing on any of those 40 pages to get sent to one new page that I post. Do I just do a meta refresh on each of those 40 htm pages? Any downsides to that?

If those pages are .htm files, then I do believe your only option is to use a META Refresh. I might suggest setting it at 10 seconds and place a message at the top of the page indicating that the page has moved. Mind you, I would never do this myself, ever. I just wouldn't feel comfortable using that method to redirect visitors to a new page.

If those pages are .asp files, just drop this code above the first line of html and you are good to go...

Classic ASP Pages

<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.example.com/new-page.asp"
%>

If they are asp.net pages, just drop this code above the first line of html...

ASP.NET Pages

<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.example.com/new-page.asp");
}
</script>

You really don't want to have to manage this many 301 redirects using IIS. Its best to get an ISAPI filter in place so it can be done easily by the site administrator (no host involvement other than the initial global setup). Once they install the global ini, each site has its own ini file at the root (functions similar to mod_rewrite). You enter one rule for each page being redirected, that's it! Just one line of code and its done on the fly.

oddsod

2:50 pm on Jun 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I tried talking them into the ISAPI_rewrite, and at $69 it seemed good value, but they went on about how it's not a 10 minute job and there's a lot of documentation/updating/training etc that would make it uneconomical even if I pick up the tab for the software.

I've had a lot of bad experience with rubbish hosts (with over 10 sites bought in the last year and dealing with a total of about 12 different hosting companies over the last 5 years). These guys have been good so far but if they can't setup this software or give me IIS admin access (yeah, right! ;)), I'll have to settle for meta redirects or give them the URLs and put pressure on them to do it manually.

pageoneresults

3:09 pm on Jun 30, 2005 (gmt 0)

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



but they went on about how it's not a 10 minute job and there's a lot of documentation / updating / training etc that would make it uneconomical even if I pick up the tab for the software.

I have to this day to understand why hosts cannot be more flexible when dealing with client requests to install software. In this particular instance, it is the hosts loss, and yours too. It is a 10 minute job, after you read the installation documentation which is fairly simple according to my server administrator.

Every single site I manage has its own ini. I'm in there frequently adding and/or modifying rewrite rules. All new sites have a default ini that includes the 301 for sub-domain to root domain or vice versa, no versa yet! I've never had a reason to chuck the dubdubdub yet.

Maybe a little more pressure from you might help. Go ahead and read the documentation yourself and then explain to them that it is not as difficult as it may seem. Also explain to them that it would put them in a different playing field because there are many who would appreciate this feature in a Windows hosting environment.

Reflect

8:07 pm on Jun 30, 2005 (gmt 0)

10+ Year Member



On the hosts side I can relate.

I don't run hosting but I admin MS boxes. Yes this looks very straight forward and I do not see a down side. However most hosts servers populate high numbers of domains/sites on each server. They, I am sure, feel why take out a whole server possbily with these types of requests?

Before I allow a new system file or appliaction in we thoroughly test in a pre production lab. We of course run scripts to create load and see what breaks (minimalist overview here). Once the app or service is passed off to production we have to provide documentation, training, and of course inital support to the front line techs. answering the phones.

So in the long run I could see turning down these types of requests. I would suggest a co-lo server, that way if it breaks it only takes your site down with it.

I jsut got turned down for somethng simulaur by my host (shared server). Sure I was upset but after thinking about it from the support end I could understand.

P1R, if you could sticky me your hosts URL I would love to have this. Keep in mind though I am talking about a 10-20 dollar shared server account though.

Sorry to ramble.

Take care,

Brian

sullen

8:20 pm on Jun 30, 2005 (gmt 0)

10+ Year Member



are they .asp or .htm pages?

if .asp you can do an asp 301 redirect. If .htm you *could* ask your host to configure IIS to run them through the asp dll, but they might not like that idea either.