undefined
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.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • 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. Intermediate & Advanced SEO
  4. 301 Redirect from ASP.NET to PHP...Is it possible?

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.

301 Redirect from ASP.NET to PHP...Is it possible?

Intermediate & Advanced SEO
3
8
3.0k
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.
  • CoGri
    CoGri Subscriber last edited by Mar 18, 2014, 7:50 AM

    Hi all,

    I'm trying to migrate my current website over to wordpress however my current website is ASP.NET and obviously Wordpress uses PHP.

    Is it possible to perform a 301 redirect from a asp.net to a php?

    Or do you need to convert the asp.net language into php?

    Or something different?

    I welcome your thoughts?

    Regards,

    Thomas Rochford

    1 Reply Last reply Reply Quote 0
    • AlanMosley
      AlanMosley last edited by Mar 19, 2014, 11:48 AM Mar 19, 2014, 11:48 AM

      Yes that's correct, or even on the same hosting account

      1 Reply Last reply Reply Quote 1
      • CoGri
        CoGri Subscriber last edited by Mar 19, 2014, 11:43 AM Mar 19, 2014, 11:43 AM

        Many thanks guys, I think I get what your saying.

        From what I understand I could just do this...

        I build up a new wordpress website on a different hosting account. Within the .htaccess file I create my 301's. Then once I point the domain from the old hosting and website to my new one everything should work fine?

        Again many thanks for your help.

        1 Reply Last reply Reply Quote 0
        • iugac
          iugac last edited by Mar 19, 2014, 12:04 PM Mar 19, 2014, 10:18 AM

          Hello Thomas,

          sorry for my late answer.

          As Alan was saying, the web server intercepts a request before it serves a page. If it finds a rule that redirects that request, there is no need for the files to exist. So you would manage the rules for the request that you want to redirect on the same server where the old domain is located. If you are redirecting to the same domain, then yes, this means the rule will be on the same server that manages that domain. When somebody looks for your page, then the DNS would point to your server's IP. After that, the request is sent to that IP and the web server will try to serve whatever is needed for that request. But if you successfully add a rule for that specific request (let's say "www.mydomain.com/page1") to be sent to another URL (let's say "www.mydomain.com/newpage"), then the server will redirect that request.

          1 Reply Last reply Reply Quote 1
          • AlanMosley
            AlanMosley last edited by Mar 19, 2014, 12:04 PM Mar 19, 2014, 8:34 AM

            Yes.

            you don't need both sets of files.

            before the request reaches your pages, it is intercepted by the webserver and checks for any 301 rules. if it finds one for that url it will redirect, even if neither of the files exist. this all happens early in the request life cycle.

            But as I said before, make things easy for yourself, only 301 the pages that had external links

            1 Reply Last reply Reply Quote 1
            • CoGri
              CoGri Subscriber last edited by Mar 19, 2014, 6:40 AM Mar 19, 2014, 6:40 AM

              Hi guys,

              Thanks for replying. Wondered however how you would get both the files to sit on the same hosting?

              I know that windows can take both PHP and ASP.NET but I have heard that windows hosting for WordPress is not as straight forward as Linux. Is it still possible to perform 301 redirects for both sets of files in Linux?

              Regards,

              Tom

              1 Reply Last reply Reply Quote 0
              • AlanMosley
                AlanMosley last edited by Mar 18, 2014, 2:50 PM Mar 18, 2014, 2:49 PM

                I would find any pages that's have external links, and only 301 them, as there is no use 301'ing pages that have no external links, you can 301 any url you want, the language is not relevant.

                What server are you on IIS(Microsoft) or Apache? For Apache then use .htaccess for iis use web.config

                Me myself I would not be moving to WordPress, you will end up with many more crawling problems

                1 Reply Last reply Reply Quote 1
                • iugac
                  iugac last edited by Mar 18, 2014, 8:04 AM Mar 18, 2014, 8:01 AM

                  Hello Thomas,

                  I did not code ASP.NET, but from my understanding, a 301 redirect does not need to be connected to the language you write code in. You could perform a 301 redirect from your web server for example (in Apache you could use the htaccess file).

                  Anyways, I think you should redirect from your asp.net file to php and everything will work ok. You can check the link below for some code examples I have found searching on Google.

                  http://www.webconfs.com/how-to-redirect-a-webpage.php

                  http://www.beyondink.com/howtos/301-redirect.php

                  Hopefully this helps!

                  Cristian

                  1 Reply Last reply Reply Quote 2
                  • 1 / 1
                  1 out of 8
                  • First post
                    1/8
                    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

                  • oceanstorm

                    301 Redirect in breadcrumb. How bad is it?

                    Hi all, How bad is it to have a link in the breadcrumb that 301 redirects? We had to create some hidden category pages in our ecommerce platform bigcommerce to create a display on our category pages in a certain format. Though whilst the category page was set to not visable in bigcommerce admin the URL still showed in the live site bread crumb. SO, we set a 301 redirect on it so it didnt produce a 404. However we have lost a lot of SEO ground the past few months.  could this be why? is it bad to have a 301 redirect in the breadrcrumb.

                    Intermediate & Advanced SEO | Jun 20, 2019, 7:32 AM | oceanstorm
                    0
                  • cathywix

                    301 Redirects to relative URLs not absolute a problem?

                    Hi we recently did a migration and a lot of content changed locations see: https://d.pr/i/RvqI81 Basically, the 301 goes to the correct location but its a relative URL (as you can see from the screenshot) rather than absolute URL. Do you think this is a high priority issue from an SEO standpoint, should we get the developer to change the redirects to absolute? Cheers.

                    Intermediate & Advanced SEO | Feb 5, 2018, 8:56 AM | cathywix
                    0
                  • dsbud

                    301 redirect hops from non-https and www

                    It's best practice to minimize the amount of 301 redirect hops. Ideally only one redirect hop. It's also best practice to 301 redirect (or at least canonical) your non-https and/or your non-www (or www) to the canonical protocol/subdomain. The simplest (and possibly the most common) way to implement canonical protocol/subdomain redirects is through a load balancer or before your app processes the request. Both of which will just blanket 301 to the canonical domain/protocol regardless if the path exists or not In which case, you could have: Two hops. i.e. hop #1 http://example.com/foo to https://example.com/foo, hop #2 https://example.com/foo to https://example.com/bar 301 to a 404. Let's say https://example.com/dog never existed, but somebody for whatever reason linked to it (maybe a typo). If I request https://www.example.com/dog, the load balancer would 301 to a 404 page. Either scenario above should be fairly rare. However, you can't control how people link to you. Should I care about either above scenario? I could have my app attempt to check if the page exists before forwarding, but that code could be complicated.

                    Intermediate & Advanced SEO | Oct 20, 2017, 1:26 AM | dsbud
                    0
                  • gozmoz

                    Moving html site to wordpress and 301 redirect from index.htm to index.php or just www.example.com

                    I found page duplicate content when using Moz crawl tool, see below. http://www.example.com
                    Page Authority 40
                    Linking Root Domains 31
                    External Link Count 138
                    Internal Link Count 18
                    Status Code 200
                    1 duplicate http://www.example.com/index.htm
                    Page Authority 19
                    Linking Root Domains 1
                    External Link Count 0
                    Internal Link Count 15
                    Status Code 200
                    1 duplicate I have recently transfered my old html site to wordpress.
                    To keep the urls the same I am using a plugin which appends .htm at the end of each page. My old site home page was index.htm. I have created index.htm in wordpress as well but now there is a conflict of duplicate content. I am using latest post as my home page which is index.php Question 1.
                    Should I also use redirect 301 im htaccess file to transfer index.htm page authority (19) to www.example.com If yes, do I use
                    Redirect 301 /index.htm http://www.example.com/index.php
                    or
                    Redirect 301 /index.htm http://www.example.com Question 2
                    Should I change my "Home" menu link to http://www.example.com instead of http://www.example.com/index.htm that would fix the duplicate content, as indx.htm does not exist anymore. Is there a better option? Thanks

                    Intermediate & Advanced SEO | Feb 23, 2017, 12:19 PM | gozmoz
                    0
                  • Townpages

                    .htaccess 301 Redirect Help! Specific Redirects and Blanket Rule

                    Hi there, I have the following domains: OLD DOMAIN: domain1.co.uk NEW DOMAIN: domain2.co.uk I need to create a .htaccess file that 301 redirects specific, individual pages on domain1.co.uk to domain2.co.uk I've searched for hours to try and find a solution, but I can't find anything that will do what I need. The pages on domain1.co.uk are all kinds of filenames and extensions, but they will be redirected to a Wordpress website that has a clean folder structure. Some example URL's to be redirected from the old website: http://www.domain1.co.uk/charitypage.php?charity=357 http://www.domain1.co.uk/adopt.php http://www.domain1.co.uk/register/?type=2 These will need to be redirected to the following URL types on the new domain: http://www.domain2.co.uk/charities/ http://www.domain2.co.uk/adopt/ http://www.domain2.co.uk/register/ I would also like a blanket/catch-all redirect from anything else on www.domain1.co.uk to the homepage of www.domain2.co.uk if there isn't a specific individual redirect in place. I'm literally tearing my hair out with this, so any help would be greatly appreciated! Thanks

                    Intermediate & Advanced SEO | Sep 16, 2013, 2:42 PM | Townpages
                    0
                  • COEDMediaGroup

                    301 redirect with /? in URL

                    For a Wordpress site that has the ending / in the URL with a ? after it... how can you do a 301 redirect to strip off anything after the / For example how to take this URL domain.com/article-name/?utm_source=feedburner and 301 to this URL domain.com/article-name/ Thank you for the help

                    Intermediate & Advanced SEO | Apr 24, 2013, 6:25 AM | COEDMediaGroup
                    0
                  • Brocberry

                    301 doesn't redirect a page that ends in %20, and others being appended with ?q=

                    I have a product page that ends /product-name**%20** that I'm trying to redirect in this way: Redirect 301 /products/product-name%20 http://www.site.com/products/product-name And it doesn't redirect at all. The others, those with %20, are being redirected to a url hybrid of old and new: http://www.site.com/products/product-name**?q=old-url** I'm using Drupal CMS, and it may be creating rules that counter my entries.

                    Intermediate & Advanced SEO | Feb 5, 2013, 6:35 AM | Brocberry
                    0
                  • coremediadesign

                    Login redirect 302

                    Ok - anyone knows what to do with the temporary redirect to the login page? In our e-commerce system we have a checkout page, which requires user to be logged in - if they are not, we redirect them to the login page using simple php header("Locaiton: url"). This however has been found as a Warning as it's a temporary redirect. I can't really put there permanent redirect for obvious reasons so if someone could give me some clue on this situation that would be much appreciated.

                    Intermediate & Advanced SEO | Apr 29, 2012, 8:45 AM | coremediadesign
                    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
                  • Local Citation 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

                  Access all your tools in one place. Whether you're tracking progress or analyzing data, everything you need is at your fingertips.

                  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.