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
-
Redirects, 301's & 404's
I have tons of links that I have had added a redirect to after creating my companies new website. Is it bad to have all these 301s? How do I permanently redirect those links? Also, on Google Search Console it's telling me I have 1,000+ excluded links. Is this bad? Will it negatively affect me? Is this something to do with my sitemap? Any help would be greatly appreciated 🙂
Technical SEO | | sammecooper0 -
Backlink management: 301 redirect unsuccessful.
I am managing my company's spammy backlinks using Open Site Explorer. Our company owns a few URLs that are related to our company or are iterations of our main URL. All of these additional URLs have 301 redirects to our main domain. Open Site Explorer has identified one of these URLs as having a spam score of 8 indicating a 56% chance of Google crawler penalization. Obviously, this is a red flag. Instead of being redirected to our main domain upon visiting the URL, I was directed to what seems to be an automatically generated, generic webpage with links that seem to have been generated by keywords from our main domain. I have seen this type of webpage before when incorrectly typing in URLs from other pages. They tend to look the same. They have a black background with the URL written in grey at the top and a rectangular related links bar. Is anyone familiar with my problem and could you offer any advice? Thanks, Ben
Technical SEO | | SOLVISTA0 -
To 301 or not to 301?
I have a client that is having a new site built. Their old site (WP) does not use the trailing / at the end of urls. The new site is using most of the same url names but IS using the /. For instance, the old site would be www.example.com/products and the new site, also WP, will be www.example.com/products/. WordPress will resolve either way, but my question is whether or not to go in and redirect each matching non / page to the new url that has the /. I don't want to leave any link juice on the table but if I can keep the juice without doing a few hundred 301s that certainly wouldn't suck. Any thoughts? Sleepless in KVegas
Technical SEO | | seorocket0 -
301 redirect after penalty to domain which currently 301 to the penalised domain
Hello all, As I have mentioned in another Q&A, one of our new clients got hit by manual penalty. I checked their link profile and there was a lot of black hat involved. Long story sort, I submitted a reconsiderationr equest which was not enough as it seems 99,9% of his links are bad links. We took the decision to move a newly launched web site from www.websitename.com to www.website-name.com with the latter being an old domain name with good authority and clean link profile. The problem is that at the moment the www.website-name.com is set to 301 redirect to www.websitename.com and what we want to do now is take the web site off www.websitename.com and launch (not 301 as we dont want to pass the penalty to the clean domain) it to www.website-name.com. What is the best practise for this particular case and are there any things i should pay attention to? I would appreciate your advise!
Technical SEO | | artdivision0 -
301 Re-direct as referral traffic
So we have this site set up in analytics as www.domain.com and then analytics is showing the referral traffic as coming from domain.com and I just wanted to make sure I'm right in the theory that Google is counting the 301 as a different site and showing what is otherwise direct traffic as traffic coming from domain.com. If that's wrong let me know. Otherwise I'll just go through with that theory since no one on any forums that I could find had an answer to it.
Technical SEO | | KateGMaker0 -
Page authority has disappeared since redirect
As the title states, my page authority (PA) has completely disappeared for certain pages on my site.
Technical SEO | | Hughescov
I have recently had a redesign and optimised the page names, redirecting the page it has replaced.
This has been nearly 2 months now and the new pages are showing PA of 1 still.
The 301 redirects definitely work so what am I doing wrong? Thanks in advance!0 -
Do 301 redirects now allow most of the bad value to pass through?
I heard after the 3.2 update that most of your bad history passes though the 301 redirect.. What do you guys think out there?
Technical SEO | | Merta19801 -
Why is a 301 redirected url still getting indexed?
We recently fixed a redirect issue in a website, and although it appears that the redirection is working fine, the url in question keeps on getting crawled, indexed and cached by google. The redirect was done a month ago, and google shows cached version of it, even for a couple of days ago. Manual checking shows that its being redirected, and also a couple of online tools i checked report a 301 redirect. Do you have any idea why this could be happening? The website I'm talking about is www.hotelmajestic.gr and its being redirected to www.hotel-majestic.gr
Technical SEO | | dim_d0