301 Redirect from ASP.NET to PHP...Is it possible?
-
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
-
Yes that's correct, or even on the same hosting account
-
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.
-
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.
-
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
-
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
-
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
-
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
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
-
301 Redirect from Authoritative but Loosely-Related Domain
We acquired a health-related blog about a year ago with good domain authority and a pretty strong link profile (TF ~40). We have been publishing good relevant content in it but it's not really paying dividends and we are considering doing a 301 to our money site, which is focused primarily on senior issues but has a lot of health-related content. The question is - with the two domains only being loosely related in subject matter, do we stand to harm our main site by redirecting from the other domain?
Intermediate & Advanced SEO | | sa_787040 -
PushState for redirects
Is it possible to use PushState for redirects from one site to another?
Intermediate & Advanced SEO | | rgamedia_seo0 -
Soft 404 error for a big, longstanding 301-redirected page
Hi everyone, Years ago, we acquired a website that had essentially 2 prominent homepages - one was like example.com and the other like example.com/htm... They served the same purpose basically, and were both very powerful, like PR7 and often had double listings for important search phrases in Google. Both pages had amassed considerable powerful links to them. About 4 years ago, we decided to 301 redirect the example.com/htm page to our homepage to clean up the user experience on our site and also, we hoped, to make one even stronger page in serps, rather than two less strong pages. Suddenly, in the past couple weeks, this example.com/htm 301-ed page started appearing in our Google Search Console as a soft 404 error. We've never had a soft 404 error before now. I tried marking this as resolved, to see if the error would return or if it was just some kind of temporary blip. The error did return. So my questions are:
Intermediate & Advanced SEO | | Eric_R
1. Why would this be happening after all this time?
2. Is this soft 404 error a signal from Google that we are no longer getting any benefit from link juice funneled to our existing homepage through the example.com/htm 301 redirect? The example.com/htm page still has considerable (albeit old) links pointing to it across the web. We're trying to make sense of this soft 404 observation and any insight would be greatly appreciated. Thanks!
Eric0 -
Hundreds of 301 Redirects. Remove Pages or Not?
Hi Mozers, I have a website that has literally got hundreds of 301 redirects. I had a close look at these URLs and only some of them have backlinks to it and remaining all of them are not indexing in Google and has got not backlinks at all. Based on what I have noticed experts mentioning, loads of 301 redirects can potentially slow down the site speed. In a case like the website I have, should I completely take off the pages from website to reduce the number of 301 redirects or should I leave 301 redirects? There is no traffic or backlinks coming from these URLs. Malika
Intermediate & Advanced SEO | | Malika10 -
When is it time to kill 301 redirects
3 months we updated our site design design and as such lots of page urls changed. At the time we 301 redirected about 100 pages. (All pages are on the same domain - 301 redirects like .com/about-us/company to .com/company) Anyhow my question is should I leave these redirects active indefinitely or kill them assuming value has passed through by now? Your Thoughts are welcomed. Thanks, Glen.
Intermediate & Advanced SEO | | AdvanceSystems0 -
Canonical OR redirect
Hi, i've a site about sport which cover matches. for each match i've a page. last week there was a match between: T1 v T2 so a page was created: www.domain.com/match/T1vT2 - Page1 this week T2 host T1, so there's a new page www.domain.com/match/T2vT1 - Page2 each page has a unique content with Authorship, but the URL, Title, Description, H1 look very similar cause the only difference is T2 word before T1. though Page2 is available for a few days, on site links & sitemap, for the search query "T2 T1 match" Page1 appears on the SERP (high location). of course i want Page2 to be on SERP for the above query cause it's the relevant match. i even don't see Page2 anywhere on the SERP and i think it wasn't indexed. Questions: 1. do you think google see both pages as duplicated though the content is different? 2. is there a difference when you search for T1 vs T2 OR T2 vs T1 ? 3. should i redirect 301 Page1 to Page2? consider that all content for Page1 and the Authorship G+ will be lost. 4. should i make rel=canonical on Page1 to Page2? 5. should i let google sort it out? i know it's a long one, thanks for your patience. Thanks, Assaf
Intermediate & Advanced SEO | | stassaf0 -
Create a link or redirect?
We have 60 demo movie pages on our site. We no longer link to these movie pages internally, because they are outdated; however, a lot of our partner companies are still linking to these pages. Some of these pages will have 10-15 linking root domains and a page authority of 30+... so pretty decent authority. These pages only include a movie on the pages, no links. I am trying to pass some of the link juice from these pages to other pages on our site. I am wondering if I should: A)Include transcripts on these pages, then link back to our current product page or solution pages? B)Set up redirects from these pages to a product or solution page? C)Set up a redirect to our homepage? Any advice? Thanks, Mike
Intermediate & Advanced SEO | | Mike.Goracke0 -
Is it ok to use both 301 redirect and rel="canonical' at the same time?
Hi everyone, I'm sorry if this has been asked before. I just wasn't able to find a response in previous questions. To fix the problems in our website regarding duplication I have the possibility to set up 301's and, at the same time, modify our CMS so that it automatically sets a rel="canonical" tag for every page that is generated. Would it be a problem to have both methods set up? Is it a problem to have a on a page that is redirecting to another one? Is it advisable to have a rel="canonical" tag on every single page? Thanks for reading!
Intermediate & Advanced SEO | | SDLOnlineChannel0