Best & easiest way to 301 redirect on IIS
-
Hi all,
What is the best and easiest way to 301 redirect URLs on IIS server?
I got access to the FTP and WordPress back office, but no access to the server admin.
Is there an easy way to create 301 redirect without having to always annoy the tech in charge of the server?
Thanks!
-
Thanks a lot for your answer
-
You have two options:
- Set it up in IIS Manager (best option, least overhead for the server, need no coding skills)
- Code it in classic ASP in a global include file that all pages reference before sending content back to the browser.
Here's a great article that walks you through the IIS config option. For this, you need access to IIS Manager:
Sounds like that option is unavailable to you however.
For the other option: your site probably has a file or two that's included at the start of all web pages. (If not, you can add it). In that file, you'll want to check the URL passed in like this:
Dim sThisPage = Request.ServerVariables("SCRIPT_NAME")
If (LCase(sThisPage) = "/oldpage.aspx") Then
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "http://" & sThisServer & "/newpage.aspx"
Response.End
End If -
Any IIS expert around?..
-
There - you can see how often I have worked on IIS servers
-
there is no .htaccess on IIS servers
-
No problem, I'll have a look for another website thanks
-
Nor was I.
If you have FTP access, you might then have to work in the .htaccess file and build the redirects in there.
-Andy
-
Bummer, I was not aware of that, its such an awesome plugin
-
Hi Vadim,
Thanks for your answer, however it looks that the redirection plugin works only for apache servers.
-
Hi Andy,
thanks, it works for IIS servers too?
- Benoit.
-
Hi Benoit,
Yes, Andy is totally on it. Server side redirects are faster, however if you have Wordpress a plugins make it so much easier and convenient.
Also if you want other powerful features like: 404 error monitoring - captures a log of 404 errors and allows you to easily map these to 301 redirects, and more Try Redirection plugin
Hope this Helps!
-
Absolutely - Install this plugin: http://wordpress.org/plugins/simple-301-redirects/
I use this on a couple of my own sites and it works a treat.
-Andy
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
How should I close my forum in a way that's best for SEO?
Hi Guys, I have a forum on a subdomain and it is no longer used. (like forum.mywebsite.com) It kind of feels like a dead limb and I don't know what's best to do for SEO. Should I just leave it as it is and let it stagnate? There is a link in the nav menu to the main domain so users have a chance to find the main domain. Or should I remove it and just redirect the whole subdomain to the main domain? I don't know if redirects would work as I doubt most of the threads would match our articles, plus there are 700 of them. The main domain is PR3 and so is the forum subdomain. Please help!
Technical SEO | | HCHQ0 -
I have an eCommerce store with a lot of 301 redirects. Would that hurt my rankings?
I use BigCommerce, and they have a system where all the URLs are dynamically generated from the name of each product. So if I named a product "widget x y z" the url would be /widget-x-y-z/, and if I changed that to "blue widget x y z", it would change to /blue-widget-x-y-z/ and automatically redirect the old one to the new one. As a result, in 6 months, because of a lot of tweaking and experimenting, I've ended up with a hefty list of 400 redirects. Some of them are very old, and some are recent. So my question is in two parts: a) does having all of these redirects hurt my rankings? b) if so, would deleting them help?
Technical SEO | | shabbirun0 -
What is the best way of inserting keywords into a social networking site
We have a social networking site called Yookos (www.yookos.com). As per the norm, many of the pages of the site carry user generated content and can only be accessed by the users themselves. i created a keyword list that our technical person the uploaded onto the site but SEOmoz shows that these keywords cannot be picked up.
Technical SEO | | seoworx123
What is the best way to make sure that our site is also picked up via search engine searches.0 -
Discontinuing a site & Redirecting Traffic to an Internal Page
We are wondering the best way to redirect the traffic from a site that will no longer exist. The Scenario:
Technical SEO | | TopFloor
Our client wants to discontinue this website http://www.animalcarepackaging.com/. We’d like to redirect the traffic from this site to an internal page on our client's other website: http://www.glenroy.com/packaging/. This internal page is the most appropriate to the content that appears on animalcarepackaging.com (as opposed to just the entire site glenroy.com). Possible Options We Are Considering:
Option 1: Keep hosting animalcarepackaging.com and add a 301 redirect for all pages to glenroy.com/packaging/. Our concern with this option is that Google/Bing will see animalcarepackaging.com as a gateway, which could hurt glenroy.com. Option 2: Keep hosting animalcarepackaging.com and add a 301 redirect so all pages are sent to glenroy.com/packaging/; AND file a change of address with Google and Bing. We believe this will allow people who have bookmarked animalcarepackaging.com to go to glenroy.com/packaging/; while people searching for animalcarepackaging.com will go to glenroy.com's home page. We would augment this by posting a message on the homepage of animalcarepackaging.com notifiying users that the site will be discontinued and info will be found at glenroy.com/packaging. Option 3: Do a change of address with Google/Bing and send all traffic to glenroy.com (rather than an internal page). Post information on the homepage of animalcarepackaging.com that the site will be discontinued on X-date, and info about animalcarepackaging.com will be able to be found at glenroy.com/packaging. Looking for feedback on our options and suggestions on how this can be handled.0 -
Htaccess code to 301 redirect a folder change
Hi, I need some help to redirect all my site as there was a folder change. eg, the old structure was www.mysite.com/stuff-1/bags.html and I need it to go to the same structure without the "-1" eg: /stuff/bags.html
Technical SEO | | Paul_MC
The "bags.html" will be lots of different products, so this would be a wildcard? What would the htaccess code need to be? Thanks0 -
What if my host doesn't have the 301 redirect feature?
Ok, So i need to do a 301 redirect but my host doesn't have the feature with htaccess. I currently use yahoo. What are my options?
Technical SEO | | bronxpad0 -
301 Redirect From Dynamic Page To Static
I want to 301 redirect all "id" and "type" numbers from my page dynamic.php page (I have thousands of IDs and thousands of Types) all to a single URL. So for example the following.... www.mysite.com/dynamic.php?id=1&type=5 www.mysite.com/dynamic.php?id=2&type=5 www.mysite.com/dynamic.php?id=3&type=5 www.mysite.com/dynamic.php?id=1&type=6 www.mysite.com/dynamic.php?id=2&type=6 www.mysite.com/dynamic.php?id=3&type=6 ...would all be sent to: www.mysite.com/page.html How can this be done without doing a redirect for each ID/Type?
Technical SEO | | TheDude1 -
Permanent 301 redirects vs canonical urls?
Im moving a website that was .php to wordpress with a few static HTML pages. Which is better use permanent 301 redirects and delte the old pages, leave the old pages and use canonical urls and 301 redirects or something else?
Technical SEO | | senith0