301 redirects
-
Hello,
I want to ditch about 1000 pages of a 2000+ page site. I believe the 301 redirect thing is the way to go but my expertise is limited. Is there a way to do a blanket redirect ie if a user or search engine looks for a page thats not there it all gets redirected to the index page or do I have to do each one manually?
Thanks
Ian
-
ok thanks
-
you can point example.com to any directory you wish...
and they should be on seperate lines, not sure why moz changes that
RewriteEngine on RewriteBase /
RewriteRule ^gallery/(.*) http://www.example.com/ [R=301,L]
-
Hello Andy,
Thanks for that.
I have most of it in a directory so just so I know I've got it right... in the htaccess file I put a line:
RewriteEngine on RewriteBase / RewriteRule ^gallery/(.*) http://www.example.com/ [R=301,L]
Where /gallery is the directory to be moved, will send everything from the directory (including stuff in subdirectories) to the index page? I do have a corresponding new gallery but the file names are different.
Cheers
-
this depends how your site is set up ... for example if you are redirecting a directory (eg .com/blog/) to your root thats easy enough to do - but if they are specific files that don't have within say the root or a folder you are not redirecting in it's entirety it would be manual work I am afraid. - see below
The other option is to drop to 404 page if you are just removing the content and not redirecting to relevant content ... admitting a page is missing and hasn't been replaced is sometimes the best way to show you are working on your site and consolidating info to be valuable to users. Also you can use your 404 page to have a big of fun and explain to users why something has gone missing or changed - or even just have a search box there.
_RewriteEngine on RewriteBase / RewriteRule ^old_dir/(.*) http://www.example.com/new_dir/ [R=301,L]_
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 in breadcrumb. How bad is it?
Hi all, How bad is it to have a link in the breadcrumb that 301 redirects? We had to create some hidden category pages in our ecommerce platform bigcommerce to create a display on our category pages in a certain format. Though whilst the category page was set to not visable in bigcommerce admin the URL still showed in the live site bread crumb. SO, we set a 301 redirect on it so it didnt produce a 404. However we have lost a lot of SEO ground the past few months. could this be why? is it bad to have a 301 redirect in the breadrcrumb.
Intermediate & Advanced SEO | | oceanstorm0 -
If my website uses CDN does thousands of 301 redirect can harm the website performance?
Hi, If my website uses CDN does thousands of 301 redirect can harm the website performance? Thanks Roy
Intermediate & Advanced SEO | | kadut1 -
Switching from HTTP to HTTPS: 301 redirect or keep both & rel canonical?
Hey Mozzers, I'll be moving several sites from HTTP to HTTPS in the coming weeks (same brand, multiple ccTLDs). We'll start on a low traffic site and test it for 2-4 weeks to see the impact before rolling out across all 8 sites. Ideally, I'd like to simply 301 redirect the HTTP version page to the HTTPS version of the page (to get that potential SEO rankings boost). However, I'm concerned about the potential drop in rankings, links and traffic. I'm thinking of alternative ways and so instead of the 301 redirect approach, I would keep both sites live and accessible, and then add rel canonical on the HTTPS pages to point towards HTTP so that Google keeps the current pages/ links/ indexed as they are today (in this case, HTTPS is more UX than for SEO). Has anyone tried the rel canonical approach, and if so, what were the results? Do you recommend it? Also, for those who have implemented HTTPS, how long did it take for Google to index those pages over the older HTTP pages?
Intermediate & Advanced SEO | | Steven_Macdonald0 -
301 redirects aren't passing value.
We recently migrated our shop to a new platform. We are using Wordpress for our main website, but we wanted a separate installation of Wordpress for our shop, so we left the main blog where it was, but moved the shop to a /shop/ sub directory with it's on WP installation. So now we have 2 installations of Wordpress. However, since we've done this, none of the pages on the new shop are ranking for anything. Their page rank is 0, and Moz page authority is 1 for every page on the new site. I've set up the proper 301 redirects, and they're redirecting fine, but none of the page value is coming over. It's been about a week now, and despite re-crawls by google, I'm not seeing any change. Also, one of the original (now re-directed) product pages still has a Page Authority of 13 according to Open Site Explorer. I know it's not high, but it had us ranking in the top 5 for a very important keyword, and now that value is being wasted. For example, one of our product pages that was ranking well was startupfashion.com/product/fashion-brand-line-sheet-template
Intermediate & Advanced SEO | | inkyj
That page is now redirected to
http://startupfashion.com/shop/product/fashion-line-sheet-template I've done 301's plenty of times and I've never seen this issue, so i'm wondering if it could have something to do with having multiple installations of Wordpress. I can't see any obvious issues with it... i have the Yoast SEO plugin configured properly on both installations, and all of the pages ARE being indexed by google. Not sure what is going on. Anyone have any experience with this, or have any ideas? Thanks!!0 -
Warning about a 302 redirect
Hello everyone, I'm testing the pro software and recently I installed an SSL Certificate on one of the websites I'm monitoring, I put in place an .htaccess directive to force all traffic to the secure version of the site (https) and I noticed how this raised a warning because my directive is forcing the traffic with a 302 redirect. These are the lines: _RewriteCond %{SERVER_PORT} 80 _ RewriteRule ^(.*)$ https://example.com/$1 [R,L] I understand that this is not good so I figured since I'm already redirecting all www to -www I can force traffic that arrives trying to use www to the secure version like so: RewriteCond %{HTTP_HOST} !^example.com$ RewriteRule (.*) https://example.com/$1 [R=301,L] But this is not 100% effective because if someone visits the site directly on the -www version this person wont get redirected hence it wont be forced to see the https. So my question is: does anybody know of an alternate way to force traffic to the secure socket using a 301 instead of a 302? Oh boy, just by writing the question I think I may have figured it out, I'll post it anyways because (1) I could be wrong and (2) It could help someone else. It just hit me but the directive that is forcing www to -www specifies what type of redirect to do here [R=301,L]. So to try to answer my own question before even posting it this could probably do the trick: _RewriteCond %{SERVER_PORT} 80 _ _RewriteRule ^(.*)$ https://example.com/$1 [_R=301,R,L] I'll be testing it out ASAP and again I'll post the question anyways just in case it doesn't work, in case someone has a good suggestion or to help someone that could be in the same situation. If this is turns out right I will need someone to slap me in the face 😐
Intermediate & Advanced SEO | | stevenpicado0 -
301 Redirect - What happens to backlinks
Hello... One of my sites is losing rankings in G. I received the webmaster notification of unnatural links... My question is, should i do a 301 redirect of every page on my site to a new domain? If so, do the backlinks (which i believe are causing my rankings to drop) carry over? How about the good backlinks? Also, what would happen to the rankings i currently have on page 1? Thanks
Intermediate & Advanced SEO | | Prime850 -
301 redirect every pages?
Good evening, my question might sound stupid but please forgive me, I am still learning SEO. If I build a new site that will replace an existing site. Is there any point to do a 301 redirect for pages that had no inbound link so, no juice to pass? I kind of think that it would be a better practice to 301 redirect each pages to a page that make sense on the new web site .... but here is why I think that. Why I say that If I am lucky, many of my old web site pages will be indexed, many of them having no inbound links. So once the new web site online, until all my new web sites pages are indexed, I could imagine Google would send people to the index pages (the old ones that do not exist anymore)... I am right? So in that case, if I do a 301 redirect only for pages that have inbound links, the user would end up on a 404 page. Could you tell me if it make sense how I think? Thanks a lot !! Nancy P.S. I would not redirect if it make no sense to the user. I fully understand that we must always keep the user experience in mind in any 404 and 301 redirect decisions. But to simplify the question, just suppose it is ok from a user perspective to map every old site pages to a page in new web site.
Intermediate & Advanced SEO | | EnigmaSolution0 -
Tread of backlinks after 301
After 301-ing a domain to a new domain, how should we tread the changing of the backlinks to the old domain? We might be able to have a certain amount changed rather quickly. Should we consider the new domain as a "new" domain, and in this sense, not have them changed quickly, (afraid to trip any filter) Or wil Google see the new domain (after indexing) with the authority of the old domain, so , if the backlinks are direct or coming through a 301 will make no difference? Hope my question is clear and excuses for my english 😛 Thanks for reading and hoping for input,
Intermediate & Advanced SEO | | elgoog0