Advanced 301 Redirects
-
Hi all!
I'm moving a blog from a subdomain to a folder on my root domain and want to make sure I am properly implementing 301's. Is there a code or method for making specific pages 301 to the corresponding new URL without having to manually 301 each?
For example, a current blog may exist at blog.website.com/3-tips-for-selling-your-home and, since we are moving the blog, will now exist at website.com/3-tips-for-selling-your-home. We obviously want to implement 301's to ensure any link equity carries over to the new url.
Anyone know how to implement these in scale to without having to set up each manually?
Thanks!
-
I've been using regexpal for a while. I think I like regex101 better.
-
This should do it:
#begin redirect
RewriteCond %{HTTP_HOST} ^subdomain.domain.com
RewriteRule ^(.*)$ http://domain.com/subfolder/$1 [R=301]
#end redirect
Regex isn't the most intuitive thing in the world, but it's a necessary evil sometimes. Here's a nice little tool to help when you have to use it: http://regex101.com/
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
-
Does redirecting the existing URLs in the website without reducing our current rankings? The new website runs on the bubble, so it seems there is no provisions to redirect the existing URLs to this platform?
Hi Moz Fans, There are some clarification needed in a website revamping and loosing of current website rank. Please go through the questions and would be great if you like to share some insights on it. 1. We would like to revamp our existing website by joining hands with the bubble visual programming platform. Thus, kindly let us know if there are provisions to redirect the existing URLs to this platform. We would also like to know if this kind of redirecting affects the current website ranking. If yes, how can we redirect the existing URLs in bubble without reducing our current rankings? 2. As a part of the revamping of our website, we would like to enquire about the possibilities of its relaunch via bubble. Does it cause any changes for the current rankings of our website if we redirect the existing URLs via bubble? If yes, is there any provision to redirect the URLs without affecting the current ranking of the website?
Web Design | | OceanAirTravels0 -
Is there a way to redirect URLs with a hash-bang (#!) format?
Hi Moz, I'm trying to redirect www.site.com/locations/#!city to www.site.com/locations/city. This seems difficult because anything after the hash character in the URL does not make it to the server thus cannot be parsed for rewriting. Is there an SEO friendly way to implement these redirects? Thanks for reading!
Web Design | | DA20130 -
Is it possible to redirect the main www. domain - but keep a subdomain active?
Hi Mozzers, Quick question, which I hope one of you can answer... Let's say I have a website (i) www.example.com and on that a subdomain exists, (ii) subdomain.example.com. Let's say I want to change my main domain from www.example.com to www.newwebsite.com. I'd 301 all content, use GWT to notify Google of a change of address etc etc. Having done that, is it still possible to keep the original subdomain active? So, even though www.example.com has been redirected / transferred to www.newwebsite.com, subdomain.example.com would still exist. If that is possible, what is the implication for Domain Authority? On the one hand, I have transferred the main site (so DA from that will transfer to the new site); but part of that root domain is still active. Make sense? Any answers? Thanks everyone...
Web Design | | edlondon0 -
Main page redirect affecting search results?
Question.... A recent change was made to our page www.BGU.edu by a marketing person. So now when you type in www.BGU.edu it actually redirects to a different page www.BGU.edu/inquiry This is a really bad idea isn't it? I do not know enough about SEO to know a lot, and just joined SEOmoz but do I need to tell the admin to change it back?
Web Design | | nongard10 -
Website Redesign 301 Question
Hey Moz gang, I have a question that I believe I know how I'm going to handle, but just wanted some feedback from the Moz community on best practices. At my company, we're going through a site redesign. At the moment, our site is deeper than it should be with many one-off feature pages. For example, we have a Features page that then links to individual pages for each specific feature. One goal we have set for the redesign is a condensing of the pages in order to make the site more user-friendly, easy to manage and content rich. My question is this. We have a lot of these individual pages that I want to essentially kill and merge into one page. It is okay (best practice) to 301 all of those individual feature specific pages to the single Features page since that is now where all of that content lives?? I want to retain the link juice that those pages have gained over time, but I don't want to get penalized for too many 301's to a single page. Any advice or previous experience would be awesome 🙂 Thanks, Lance
Web Design | | RobinBryant10 -
Display a message after 301 redirect.
I know this one is a little more technical than pure SEO, but it somewhat ties in. I'm redirecting 2 sites to one. The companies have combined, and I've imported all their content that has been created, and the url mapping is set up correctly. So it currently is set up like this: A.com --> C.com
Web Design | | WilliamBay
A.com/blogpost-1 --> C.com/blogpost-1 B.com --> C.com B.com/blogpost-20 --> C.com/blogpost-20 What i would like is some method a redirect when landing at C.com or C.com/blogpost-XX. And in turn display a message in a DIV so I can style it. And yes, I have nothing better to do on a Friday night 🙂0 -
Is it OK to 301 Redirect http://homepage.com to http://blog.homepage.com?
I don't have a homepage built yet, and I suspect that my blog will be my primary SEO draw in the long term, so I'd like to do a 301 redirect (for the techies, I'm doing it in Django with http.HttpResponsePermanentRedirect ) I just wanted to confirm that this wouldn't cause any problems as Google gets used to my page (it's only been up for a few days) Thanks! -matt
Web Design | | 49wetnoodles0 -
Redirecting 301 Redirects -- Will Search Engines Notice?
Hello Mozzers, We're currently evaluating a client site where the previous web developer redesigned the site and got lazy, 301 redirecting hundreds of pages to the home page instead of to their respective new URLs. Ugh. In any case, we will probably fix this for the sake of implementing best practices. But I am curious how search engines treat 301'd URLs, as they are supposed to be permanent redirects. Will search crawlers ever visit the old URLs again to find that we've re-redirected them? Or have they written them off as moved to the home page for good, meaning that there's no way to direct the authority of the previous URLs to their rightful targets? Thanks!
Web Design | | SEOTeamSF0