Skip to content
    Moz logo Menu open Menu close
    • Products
      • Moz Pro
      • Moz Pro Home
      • Moz Local
      • Moz Local Home
      • STAT
      • Moz API
      • Moz API Home
      • Compare SEO Products
      • Moz Data
    • Free SEO Tools
      • Domain Analysis
      • Keyword Explorer
      • Link Explorer
      • Competitive Research
      • MozBar
      • More Free SEO Tools
    • Learn SEO
      • Beginner's Guide to SEO
      • SEO Learning Center
      • Moz Academy
      • SEO Q&A
      • Webinars, Whitepapers, & Guides
    • Blog
    • Why Moz
      • Agency Solutions
      • Enterprise Solutions
      • Small Business Solutions
      • Case Studies
      • The Moz Story
      • New Releases
    • Log in
    • Log out
    • Products
      • Moz Pro

        Your all-in-one suite of SEO essentials.

      • Moz Local

        Raise your local SEO visibility with complete local SEO management.

      • STAT

        SERP tracking and analytics for enterprise SEO experts.

      • Moz API

        Power your SEO with our index of over 44 trillion links.

      • Compare SEO Products

        See which Moz SEO solution best meets your business needs.

      • Moz Data

        Power your SEO strategy & AI models with custom data solutions.

      NEW Keyword Suggestions by Topic
      Moz Pro

      NEW Keyword Suggestions by Topic

      Learn more
    • Free SEO Tools
      • Domain Analysis

        Get top competitive SEO metrics like DA, top pages and more.

      • Keyword Explorer

        Find traffic-driving keywords with our 1.25 billion+ keyword index.

      • Link Explorer

        Explore over 40 trillion links for powerful backlink data.

      • Competitive Research

        Uncover valuable insights on your organic search competitors.

      • MozBar

        See top SEO metrics for free as you browse the web.

      • More Free SEO Tools

        Explore all the free SEO tools Moz has to offer.

      What is your Brand Authority?
      Moz

      What is your Brand Authority?

      Check yours now
    • Learn SEO
      • Beginner's Guide to SEO

        The #1 most popular introduction to SEO, trusted by millions.

      • SEO Learning Center

        Broaden your knowledge with SEO resources for all skill levels.

      • On-Demand Webinars

        Learn modern SEO best practices from industry experts.

      • How-To Guides

        Step-by-step guides to search success from the authority on SEO.

      • Moz Academy

        Upskill and get certified with on-demand courses & certifications.

      • SEO Q&A

        Insights & discussions from an SEO community of 500,000+.

      Unlock flexible pricing & new endpoints
      Moz API

      Unlock flexible pricing & new endpoints

      Find your plan
    • Blog
    • Why Moz
      • Small Business Solutions

        Uncover insights to make smarter marketing decisions in less time.

      • Agency Solutions

        Earn & keep valuable clients with unparalleled data & insights.

      • Enterprise Solutions

        Gain a competitive edge in the ever-changing world of search.

      • The Moz Story

        Moz was the first & remains the most trusted SEO company.

      • Case Studies

        Explore how Moz drives ROI with a proven track record of success.

      • New Releases

        Get the scoop on the latest and greatest from Moz.

      Surface actionable competitive intel
      New Feature

      Surface actionable competitive intel

      Learn More
    • Log in
      • Moz Pro
      • Moz Local
      • Moz Local Dashboard
      • Moz API
      • Moz API Dashboard
      • Moz Academy
    • Avatar
      • Moz Home
      • Notifications
      • Account & Billing
      • Manage Users
      • Community Profile
      • My Q&A
      • My Videos
      • Log Out

    The Moz Q&A Forum

    • Forum
    • Questions
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. Home
    2. SEO Tactics
    3. Technical SEO
    4. Best & easiest way to 301 redirect on IIS

    Moz Q&A is closed.

    After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.

    Best & easiest way to 301 redirect on IIS

    Technical SEO
    4
    13
    3424
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with question management privileges can see it.
    • 2MSens
      2MSens last edited by

      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!

      1 Reply Last reply Reply Quote 0
      • 2MSens
        2MSens @MichaelC-15022 last edited by

        Thanks a lot for your answer 🙂

        1 Reply Last reply Reply Quote 0
        • MichaelC-15022
          MichaelC-15022 last edited by

          You have two options:

          1. Set it up in IIS Manager (best option, least overhead for the server, need no coding skills)
          2. 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:

          http://www.proworks.com/blog/2010/02/11/adding-a-301-redirect-in-iis-for-individual-pages-with-non-aspx-extensions/

          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

          2MSens 1 Reply Last reply Reply Quote 1
          • 2MSens
            2MSens last edited by

            Any IIS expert around?.. 😃

            1 Reply Last reply Reply Quote 0
            • Andy.Drinkwater
              Andy.Drinkwater @2MSens last edited by

              There - you can see how often I have worked on IIS servers 😉

              1 Reply Last reply Reply Quote 1
              • 2MSens
                2MSens @Andy.Drinkwater last edited by

                there is no .htaccess on IIS servers 😉

                Andy.Drinkwater 1 Reply Last reply Reply Quote 0
                • 2MSens
                  2MSens @vmialik last edited by

                  No problem, I'll have a look for another website 😉 thanks

                  1 Reply Last reply Reply Quote 0
                  • Andy.Drinkwater
                    Andy.Drinkwater @vmialik last edited by

                    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

                    2MSens 1 Reply Last reply Reply Quote 0
                    • vmialik
                      vmialik @2MSens last edited by

                      Bummer, I was not aware of that, its such an awesome plugin

                      Andy.Drinkwater 2MSens 2 Replies Last reply Reply Quote 1
                      • 2MSens
                        2MSens @vmialik last edited by

                        Hi Vadim,

                        Thanks for your answer, however it looks that the redirection plugin works only for apache servers.

                        vmialik 1 Reply Last reply Reply Quote 0
                        • 2MSens
                          2MSens @Andy.Drinkwater last edited by

                          Hi Andy,

                          thanks, it works for IIS servers too?

                          • Benoit.
                          1 Reply Last reply Reply Quote 0
                          • vmialik
                            vmialik last edited by

                            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!

                            2MSens 1 Reply Last reply Reply Quote 0
                            • Andy.Drinkwater
                              Andy.Drinkwater last edited by

                              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

                              2MSens 1 Reply Last reply Reply Quote 0
                              • 1 / 1
                              • First post
                                Last post

                              Got a burning SEO question?

                              Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


                              Start my free trial


                              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.

                              • See all categories

                              Related Questions

                              • TaraLP

                                Delete old blog posts after 301 redirects to new pages?

                                Hi Moz Community, I've recently created several new pages on my site using much of the same copy from blog posts on the same topics (we did this for design flexibility and a few other reasons). The blogs and pages aren't exactly identical, as the new pages have much more content, but I don't think there's a point to having both and I don't want to have duplicate content, so we've used 301 redirects from the old blog posts to the new pages of the same topic. My question is: can I go ahead and delete the old blog posts? (Or would there be any reasons I shouldn't delete them?) I'm guessing with the 301 redirects, all will be well in the world and I can just delete the old posts, but I wanted to triple check to make sure. Thanks so much for your feedback, I really appreciate it!

                                Technical SEO | | TaraLP
                                1
                              • Alces

                                Best way to handle Breadcrumbs for Blog Posts in multiple categories?

                                The site in question uses Wordpress. They have a Resources section that is broken into two categories (A or B). Underneath each of these categories is 5 or 6 subcategories. The structure looks like this: /p/main-category-a/subcategory/blog-post-name /p/main-category-b/subcategory/blog-post-name All posts have a main category, but other posts often have multiple subcategories while some posts also fall into both main categories. What would be the easiest or most effective way to auto-populate the breadcrumb based on from where the person reached the blog post? So for example, a way to set Home -> Main Category -> Subcategory 1 as the breadcrumb if they reach it from the Subcategory 1 landing page. Or is this not possible and we should just set the breadcrumb manually based on where we feel it best lives? Thanks.

                                Technical SEO | | Alces
                                0
                              • Cocoonfxmedia

                                301 Redirect non existant pages

                                Hi I have 100's of URL's appearing in Search Console for example: ?p=1_1 These go to on to 5_200 etc.. I have tried to do htaccess and the mod rewrite is on as I can redirect directories to the root i.e RewriteRule ^web_example(.*)$ /$1 [R=301,N,L] However I have tried all kinds of variations to redirect ?p= and either it doesn't work at all or it crashes the website. Can anyone point me in the right direction to fix this.

                                Technical SEO | | Cocoonfxmedia
                                0
                              • wcbuckner

                                Best way to noindex long dynamic urls?

                                I just got a Mozcrawl back and see lots of errors for overly dynamic urls. The site is a villa rental site that gives users the ability to search by bedroom, amenities, price, etc, so I'm wondering what the best way to keep these types of dynamically generated pages with urls like /property-search-page/?location=any&status=any&type=any&bedrooms=9&bathrooms=any&min-price=any&max-price=any from indexing. Any assistance will be greatly appreciated : )

                                Technical SEO | | wcbuckner
                                0
                              • Oxfordcomma

                                Increase 404 errors or 301 redirects?

                                Hi all, I'm working on an e-commerce site that sells products that may only be available for a certain period of time. Eg. A product may only be selling for 1 year and then be permanently out of stock. When a product goes out of stock, the page is removed from the site regardless of any links it may have gotten over time. I am trying to figure out the best way to handle these permanently out of stock pages. At the moment, the site is set up to return a 404 page for each of these products. There are currently 600 (and increasing) instances of this appearing on Google Webmasters. I have read that too many 404 errors may have a negative impact on your site, and so thought I might 301 redirect these URLs to a more appropriate page. However I've also read that too many 301 redirects may have a negative impact on your site. I foresee this to be an issue several years down the road when the site has thousands of expired products which will result in thousands of 404 errors or 301 redirects depending on which route I take. Which would be the better route? Is there a better solution?

                                Technical SEO | | Oxfordcomma
                                0
                              • ulefos

                                Remove html file extension and 301 redirects

                                Hi Recently I ask for some work done on my website from a company,  but I am not sure what they've done is right.
                                What I wanted was html file extensions to be removed like
                                /ash-logs.html to /ash-logs
                                also the index.html to www.timports.co.uk
                                I have done a crawl diagnostics and have duplicate page content and 32 page title duplicates. This is so doing my head in please help This is what is in the .htaccess file <ifmodule pagespeed_module="">ModPagespeed on
                                ModPagespeedEnableFilters extend_cache,combine_css, collapse_whitespace,move_css_to_head, remove_comments</ifmodule> <ifmodule mod_headers.c="">Header set Connection keep-alive</ifmodule> <ifmodule mod_rewrite.c="">Options +FollowSymLinks -MultiViews</ifmodule> DirectoryIndex index.html RewriteEngine On 
                                 # Rewrite valid requests on .html files  RewriteCond %{REQUEST_FILENAME}.html -f RewriteRule ^ %{REQUEST_URI}.html?rw=1 [L,QSA] 
                                 # Return 404 on direct requests against .html files RewriteCond %{REQUEST_URI} .html$  
                                RewriteCond %{QUERY_STRING} !rw=1 [NC]
                                 RewriteRule ^ - [R=404] AddCharset UTF-8 .html # <filesmatch “.(js|css|html|htm|php|xml|swf|flv|ashx)$”="">#SetOutputFilter DEFLATE #</filesmatch> <ifmodule mod_expires.c="">ExpiresActive On
                                ExpiresByType image/gif "access plus 1 years"
                                ExpiresByType image/jpeg "access plus 1 years"
                                ExpiresByType image/png "access plus 1 years"
                                ExpiresByType image/x-icon "access plus 1 years"
                                ExpiresByType image/jpg "access plus 1 years"
                                ExpiresByType text/css "access 1 years"
                                ExpiresByType text/x-javascript "access 1 years"
                                ExpiresByType application/javascript "access 1 years"
                                ExpiresByType image/x-icon "access 1 years"</ifmodule> <files 403.shtml="">order allow,deny allow from all</files> redirect 301 /PRODUCTS http://www.timports.co.uk/kiln-dried-logs
                                redirect 301 /kindling_firewood.html http://www.timports.co.uk/kindling-firewood.html
                                redirect 301 /about_us.html http://www.timports.co.uk/about-us.html
                                redirect 301 /log_delivery.html http://www.timports.co.uk/log-delivery.html redirect 301 /oak_boards_delivery.html http://www.timports.co.uk/oak-boards-delivery.html
                                redirect 301 /un_edged_oak_boards.html http://www.timports.co.uk/un-edged-oak-boards.html
                                redirect 301 /wholesale_logs.html http://www.timports.co.uk/wholesale-logs.html redirect 301 /privacy_policy.html http://www.timports.co.uk/privacy-policy.html redirect 301 /payment_failed.html http://www.timports.co.uk/payment-failed.html redirect 301 /payment_info.html http://www.timports.co.uk/payment-info.html

                                Technical SEO | | ulefos
                                1
                              • NaescentAdam

                                Index.php and 301 redirect with Joomla

                                Hi, I'm running Joomla 1.7 with SEF on and I'm trying to do a htaccess redirect which fails. I have approximately 100 in effect so far and all working fine, but I have one snag. Index.php is not working as I need it to when it's redirected to www.myurl.com/ If I turn on index.php redirect to root using this code #index.php to root
                                RewriteCond %{HTTP_HOST} ^myurl.com$ [OR]
                                RewriteCond %{HTTP_HOST} ^www.myurl.com$
                                RewriteRule ^index.php$ "http://www.myurl.com/" [R=301,L] And then go to www.myurl.com/test.html I'm redirected to the homepage. I think this is because all pages are index.php in joomla. SEOMOZ and Google both think that index.php and root are duplicate pages. Does anyone have any advice for overcoming this? Thanks, Adam

                                Technical SEO | | NaescentAdam
                                0
                              • steffen_

                                Double 301 redirect

                                Hi together, due to some technical reasons I have redirect (301) an existing link two times. Example: www.mydomain.com/root/site.html > 301 > www.mydomain.com/site.html > 301 www.mydomain.com/site_new.html Is there anybody how has got some experience like doing a double redirect? What about link juice? Best regards Steffen

                                Technical SEO | | steffen_
                                0

                              Get started with Moz Pro!

                              Unlock the power of advanced SEO tools and data-driven insights.

                              Start my free trial
                              Products
                              • Moz Pro
                              • Moz Local
                              • Moz API
                              • Moz Data
                              • STAT
                              • Product Updates
                              Moz Solutions
                              • SMB Solutions
                              • Agency Solutions
                              • Enterprise Solutions
                              Free SEO Tools
                              • Domain Authority Checker
                              • Link Explorer
                              • Keyword Explorer
                              • Competitive Research
                              • Brand Authority Checker
                              • MozBar Extension
                              • MozCast
                              Resources
                              • Blog
                              • SEO Learning Center
                              • Help Hub
                              • Beginner's Guide to SEO
                              • How-to Guides
                              • Moz Academy
                              • API Docs
                              About Moz
                              • About
                              • Team
                              • Careers
                              • Contact
                              Why Moz
                              • Case Studies
                              • Testimonials
                              Get Involved
                              • Become an Affiliate
                              • MozCon
                              • Webinars
                              • Practical Marketer Series
                              • MozPod
                              Connect with us

                              Contact the Help team

                              Join our newsletter
                              Moz logo
                              © 2021 - 2025 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                              • Accessibility
                              • Terms of Use
                              • Privacy

                              Looks like your connection to Moz was lost, please wait while we try to reconnect.