Go Back   Tech Support Forum > Design Forum > Web Serving and Management

User Tag List

How do you implement 301 redirects in IIS 6 using web.config?

This is a discussion on How do you implement 301 redirects in IIS 6 using web.config? within the Web Serving and Management forums, part of the Tech Support Forum category. Hi, I've recently redeveloped my website, and as a result some of the URLs have changed. I'm trying to add


Closed Thread
 
Thread Tools Search this Thread
Old 06-07-2013, 02:56 AM   #1
Registered Member
 
Join Date: Jun 2013
Posts: 2
OS: XP



Hi,

I've recently redeveloped my website, and as a result some of the URLs have changed. I'm trying to add 301 redirects, so that PageRank from my old pages flow to my new pages.

I've found out from my hosting company that the server my site is hosted on is using IIS 6. I only have access to my server through FTP, so (as far as I know) I can only implement the 301 redirects by uploading a web.config file to the same folder that contains my webpages.

I created a blank web.config file, added the following code and uploaded it to see if it would work:

Code:
<?xml version="1.0"?>
     <configuration>
      <location path="test.html">
       <system.web>
         <httpRedirect enabled="true" destination="https://www.mysite.com/contact.html" httpResponseStatus="Permanent" />
       </system.web>
      </location>
     </configuration>
Unfortunately, this has no effect. Visiting test.html doesn't result in a redirect to contact.html. Test.html just loads as normal and nothing happens.

I'm not sure if it's a coding issue, (as most of the forums seem to suggest the above code) or a configuration issue at the hosting company's end. They've informed me that it's a coding issue and that they don't have to install or configure anything at their end.

I'm new to web.config files, so I'm not sure if they're correct.

Can anyone shed any light on what the problem is, or what I have to do to get this to work? Any help would be greatly appreciated.

Thanks.
romario11 is offline  
Sponsored Links
Advertisement
 
Old 06-07-2013, 01:53 PM   #2
Moderator
- Design Team
- Networking Team
 
Fjandr's Avatar
 
Join Date: Sep 2012
Location: Spokane, WA
Posts: 2,483
OS: Windows XP SP3, Windows 7 SP1, Debian, CentOS

My System


Does their tech support not provide any information regarding their configuration? They should be able to tell you how to structure the redirect if it's possible.

That said, I'd get a Linux host that allows shell access, unless you're tied to IIS in some way. There's a number of very good reasons most of the world relies on Linux hosting.
__________________

Fjandr is offline  
Old 06-07-2013, 02:35 PM   #3
Registered Member
 
Join Date: Jun 2013
Posts: 2
OS: XP



Thanks for your reply.

The quality of support I receive isn't the best. They informed me that it's a coding issue and that there's nothing they have to install or configure at their end. They said I should be able to implement the redirects via the web.config file but said coding isn't something they support.

All my web pages are built in HTML, styled in CSS and interspersed with some JavaScript. My contact page links to an ASP file and I was informed by their support team that this wouldn't work on Linux. That's why they advised me to go with a Windows server in the first place.

I guess there's two questions:

1) Can I use the web.config file to implement 301 redirects in IIS 6?
2) If I asked them to migrate me to a Linux server, would my contact form still work?

Thanks for your help.
romario11 is offline  
Sponsored Links
Advertisement
 
Old 06-07-2013, 03:41 PM   #4
Moderator
- Design Team
- Networking Team
 
Fjandr's Avatar
 
Join Date: Sep 2012
Location: Spokane, WA
Posts: 2,483
OS: Windows XP SP3, Windows 7 SP1, Debian, CentOS

My System


Unless the host supports the MONO framework, ASP pages won't be interpreted under Linux. Is there a reason your contact page must be written in ASP? There are a ton of PHP contact forms available under Linux.

As for the web.config, I'm not familiar with IIS redirects, so I couldn't say whether or not it would work.

As far as I can tell, you should use the following to implement a permanent redirect using web.config:
Code:
<rule>
<action type="Redirect" redirectType="Permanent" url="https://www.example.com/{R:1}" />
</rule>
__________________

Fjandr is offline  
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is on
Smilies are on
[IMG] code is on
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Post a Question


» Site Navigation
 > FAQ
  > 10.0.0.2
Powered by vBadvanced CMPS v3.2.3


All times are GMT -7. The time now is 10:27 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
vBulletin Security provided by vBSecurity v2.2.2 (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.1.0 (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Copyright 2001 - 2018, Tech Support Forum

Windows 10 - Windows 7 - Windows XP - Windows Vista - Trojan Removal - Spyware Removal - Virus Removal - Networking - Security - Top Web Hosts