The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

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

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Intermediate & Advanced SEO
    4. 301 Redirect from ASP.NET to PHP...Is it possible?

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

    Intermediate & Advanced SEO
    8 3 1.6k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • CoGri
      CoGri last edited by

      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
      • iugac
        iugac last edited by

        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
        • AlanMosley
          AlanMosley last edited by

          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
          • CoGri
            CoGri last edited by

            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

              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
              • iugac
                iugac last edited by

                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
                • CoGri
                  CoGri last edited by

                  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
                  • AlanMosley
                    AlanMosley last edited by

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

                    1 Reply Last reply Reply Quote 1
                    • 1 / 1
                    • First post
                      Last post
                    • Moving html site to wordpress and 301 redirect from index.htm to index.php or just www.example.com
                      zeehj
                      zeehj
                      0
                      4
                      1.3k

                    • 301 Redirects... Redirect all content at once or in increments?
                      Koki.Mourao
                      Koki.Mourao
                      0
                      6
                      175

                    • Is it possible to avoid redirect of penalties for 301 forwards?
                      petersocapro
                      petersocapro
                      0
                      3
                      320

                    • Php 301 redirect
                      IOHanna
                      IOHanna
                      0
                      5
                      683

                    • How to use a 301 Redirect when the first 301 Redirect is not the same as what's indexed?
                      PatriotOutfitters81
                      PatriotOutfitters81
                      0
                      3
                      66

                    • 301 Redirect To Another 301 Redirect
                      cbielich
                      cbielich
                      0
                      5
                      247

                    • 301 redirect subdomain to path and 301 for popular pages
                      Mike.Goracke
                      Mike.Goracke
                      0
                      2
                      187

                    • Upgrade Website from ASP to ASP.NET - 301 or URL Rewrite?
                      AlanMosley
                      AlanMosley
                      0
                      5
                      811

                    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
                    • Digital Marketers
                    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
                    Moz logo
                    © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                    • Accessibility
                    • Terms of Use
                    • Privacy