301 redirecting some pages directly, and the rest to a single page
-
I've read through the Redirect guide here already but can't get this down in my .htaccess
I want to redirect some pages specifically (/contactinfo.html to the new /contact.php)
And I want all other pages (not all have equivalent pages on the new site) to redirect to my new (index.php) homepage.
How can I set it up so that some specific pages redirect directly, and all others go to one page?
I already have the specific oldpage.html -> newpage.php redirects in place, just need to figure out the broad one for everything else.
-
also, keep in mind that if you are ranking on secondary terms on the non-front pages, you will lose a lot of that relevance by forwarding to only your home page (esp. if it's not about that specific thing.
example:
old site about fruit on home page - old subpage about applesthe old subpage about apples may rank really well
next, you forward the old subpage about apples to your new front page
the search engines go "oh, this page isn't as relevant as the old apples subpage that no longer exists, let's bump down the rankings"hence, it's always best to forward your equivalent old content to your equivalent new content.
-
hi -
how many pages are we talking here?check with your website host. many of of them have redirect utilities (such as isapi_rewrite : http://www.isapirewrite.com/) installed on the server (or just "rewrite" for apache i think) that will allow you to add a set of rules to your .htacess so it filters the way you want every time someone hits an old page. you would need 2 rules:
1.) when site is contactinfo.html --> contact.php
2.) when all others ---> send to index.phpi would highly advise forwarding more relevant pages to their new equivalents if they are available. doing it the way you've mentioned will send link juice to index.php, but you may run into relevance issues.
isapi_rewrite is a little complicated in terms of it's syntax rules, but they've got a pretty useful forum. additionally, sometimes website hosts have a pro that can help you if you can't figure it out.
hope that's of some help! :>)
dan
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
-
Forced Redirects/HTTP<>HTTPS 301 Question
Hi All, Sorry for what's about to be a long-ish question, but tl;dr: Has anyone else had experience with a 301 redirect at the server level between HTTP and HTTPS versions of a site in order to maintain accurate social media share counts? This is new to me and I'm wondering how common it is. I'm having issues with this forced redirect between HTTP/HTTPS as outlined below and am struggling to find any information that will help me to troubleshoot this or better understand the situation. If anyone has any recommendations for things to try or sources to read up on, I'd appreciate it. I'm especially concerned about any issues that this may be causing at the SEO level and the known-unknowns. A magazine I work for recently relaunched after switching platforms from Atavist to Newspack (which is run via WordPress). Since then, we've been having some issues with 301s, but they relate to new stories that are native to our new platform/CMS and have had zero URL changes. We've always used HTTPS. Basically, the preview for any post we make linking to the new site, including these new (non-migrated pages) on Facebook previews as a 301 in the title and with no image. This also overrides the social media metadata we set through Yoast Premium. I ran some of the links through the Facebook debugger and it appears that Facebook is reading these links to our site (using https) as redirects to http that then redirect to https. I was told by our tech support person on Newspack's team that this is intentional, so that Facebook will maintain accurate share counts versus separate share counts for http/https, however this forced redirect seems to be failing if we can't post our links with any metadata. (The only way to reliably fix is by adding a query parameter to each URL which, obviously, still gives us inaccurate share counts.) This is the first time I've encountered this intentional redirect thing and I've asked a few times for more information about how it's set up just for my own edification, but all I can get is that it’s something managed at the server level and is designed to prevent separate share counts for HTTP and HTTPS. Has anyone encountered this method before, and can anyone either explain it to me or point me in the direction of a resource where I can learn more about how it's configured as well as the pros and cons? I'm especially concerned about our SEO with this and how this may impact the way search engines read our site. So far, nothing's come up on scans, but I'd like to stay one step ahead of this. Thanks in advance!
Technical SEO | | ogiovetti0 -
301 Redirect back to original domain
We have a site, domainA.com and we split part of the site off into it's own site a couple of years ago as domainB.com. All urls from DomainA were 301 redirected to DomainB, but with a different folder structure. For business reasons, we now shuttering domainB and rolling it back into domainA. For the 301 redirects for urls that were on the original domainA, should I overwrite them to the new folder structure directly from the original urls? In other words: 301 redirect domainA.com/oldstructure to domainA.com/newstructure rather than: Existing 301 redirect domainA.com/oldstructure to domainB.com/newstructuretopic with a new 301 redirect to domainA.com/newstructuretopictopic
Technical SEO | | ang0 -
Static site to wordpress - avoiding 301 redirects
Moving our static website to wordpress, pages currently end in the .htm extension and for reasons of me having to do all the moving myself and wanting to preserve link equity is there any way I can run the pages with a .htm extension in Wordpress? Tried using a plug-in by Daddy Design but it seems a bit hit and miss at times. I basically need to keep the url's the same as I will not be able to get the vast majority of my links altered to the new pages, plus I am doing this by myself!
Technical SEO | | Jon-C0 -
Crawl Diagnostic: Notices about 301 redirects
There are detected five 301 redirects on my site and I want to understand why this is happening? And is this important to fix? http://domain.cl/subfolder ---- redirects to ----> http://domain.cl/subfolder/ What does this tell me "/" I am very curious 🙂 Thanks for every answer
Technical SEO | | inlinear
Holger0 -
Where to put 301 redirects in Magento?
I will be changing the URL structure in a magento store from "base/category/subcategory/product" to "base/product" which means i have to make over 1000 URL 301 redirects so our old links still work. Should i put the redirects in a .htaccess file so they stay intact no matter what or should i just put them in with all the other rewrites (in Magento 's URL rewrite manager)? Thanks
Technical SEO | | tilenkrivec0 -
How do I 301 redirect a number of pages to one page
I want to redirect all pages in /folder_A /folder_B to /folder_A/index.php. Can I just write one or two lines of code to .htaccess to do that?
Technical SEO | | Heydarian0 -
Penguin 301 Re-Direct
Hi I already know the answer to this but wanted some backup. A friend of mine has asked me to take a look at his site. He was using an SEO company that saw him get hit hard by Penguin. He did the right thing and started all over with a new domain name. I've just noticed that the old domain name is actually setup to 301 to the new domain. This has to be a bad thing right?
Technical SEO | | brightonseorob0 -
301 redirect from domain to home.aspx
We have been asked to look at a website and have found a 301 redirect from the domain www.domain.com to www.domain.com/home.aspx. Why would someone do this, this way round? We can't think of a good reason and are wondering if we have overlooked something? Thanks for your help.
Technical SEO | | travelinnovations0