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 -
WordPress and Redirects
I just converted my site to wordpress. Previously urls like www.waikoloavacationrentals.com/kolea-rentals/9g and www.waikoloavacationrentals.com/kolea-rentals/9g.html would go to the same page. Since using wordpress the first one will not work. I did not have redirects set up so was wondering if there is something I am forgetting to easily make it to where if someone types in both urls it will go to the same page.
Web Design | | RobDalton0 -
Is it necessary to Remove 301 redirects from Wordpress after removing the 404 url from Google Webmaster?
There were many 404 urls in my site found by Google Webmaster. I've redirected these urls to the relevant urls with 301 redirect in wordpress. After that I removed these 404 urls from Google Index through Webmaster. "Should I cleanup these 301 redirects from Wordpress or not? ". Help Needed.
Web Design | | SangeetaC0 -
HTTPS redirecting to subdomain; do I need to 301 to HTTP first?
Hello there, quick question on HTTPS downgrade to HTTP. Originally, full site was HTTPS. Redesign eliminated need for secure layer. Site currently has https 301'd to sub.domain.com. Ideally, site would live at domain.com, but with the old site having been indexed https, the security warning triggers when you visit, hence the 301 to a subdomain. Thinking possible solutions here are to a) add back in secure layer or b) 301 all old https pages to new http pages. Have I overlooked something? With (a), I will see no SEO impact, correct? With (b), can I expect impact similar to a relaunch? Have seen a lot of chatter that there is some impact in switching http to https, but not much the other way. Any help much appreciated!
Web Design | | alimo0 -
What happens if I 301 Redirect my homepage to a different page on site
If i were to 301 redirect the index page of my website to a page in a different subdirectory of my site would that adversely affect SEO? Does your home page need to be in the root of your site? I'm asking because a developer has told me that it would be best to do that since he needs to install OpenCart on the root of our domain...
Web Design | | SheffieldMarketing0 -
Should I create a microsite or will 301 be sufficient?
We have a client http://www.shedfinders.com/, new site and we are slowly building DA & PA for. However they have another domain industrialpropertyscotland (one of the keywords they want to rank for) Should we create a little microsite attached to the main site - Say "Your guide to buying industrial property in Scotland" or should we just stick to a 301 redirect and keep working on the main Shedfinders site? Thanks, Laura
Web Design | | lauratagdigital0 -
Site Re-Design - Running old XML site map for 301's
Hi all, We are going to launch a new site design for our current e-commerce site. I have taken this opportunity to change some categories due to keyword research and all old categories will be 301ed to best fitting new category. So I have 2 questions about moving stuff over; 1. I read that leaving the old xml site map running for the first week, would help, because this would give crawlers the chance to run through the site and follow the 301s, which would help pass the juice. How true does this sound? 2. I was thinking of re-writing all category and sub category titles, meta descriptions and on page content. The positive of this is loads of fresh content - but doing this all at the same time with the new site launch might see some major dropping in search ranking. I've identified our top traffic keyword terms/pages, would it be more wise to leave these pages, and change the others, or would the total new fresh burst have a better impact? Cheers
Web Design | | ToxicFox0 -
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