Need some help with a tricky 301
-
I can't find anything online that deals with this issue. I have a page getting indexed by Google at mydomain.com/widgets and I don't know why. No links to it anywhere. The page it is closest to is mydomain.com/reviews/widgets and so I tried to set up a 301 to point one to the other.
The problem is each individual widget review is at mydomain.com/widgets/reviews/products/widget-name and so when I redirect /widgets to mydomain.com/reviews/widgets it also redirects each individual product to mydomain.com/reviews/widgets/reviews/products/widget-name.
Is there some way to just redirect /widgets without having it affect each product review? I cannot change URL structure either, nature of the site. Any ideas?
-
Hi Daniel,
Whenever I hear "Nothing is redirecting when I add this to the .htaccess file" I have one thought:
Is the site using Joomla, Drupal or some other CMS that will overwrite .htaccess rules externally?
Sha
-
Just not happening. I'm just not going to worry about it, thanks for your help
-
Gotcha. Try adding the rewriteengine on line directly above those two rules. That has to be present to trigger the mod_rewrite module. Hopefully that will solve the issue.
-
Yeah I took the ReweriteEngine On line out and just added the RewriteRule line in underneat that one. Although it doesn't say anywhere RewriteEngine On in the .htaccess file already, so not sure how that works.
-
Well, that's no fun. If there is already a line to initiate the rewrite engine, that 2nd 'rewriteengine on' reference could be a problem. I assume you took that out?
-
It is not working for me. Nothing is redirecting when I add this to the .htaccess file. First I added it as you suggested at the bottom of everything. Nothing happened so I added right after another line of code that was already in there that started with RewriteRule. This is the line that was already there:
RewriteRule ^.*$ index.php [NC,L]
Any idea what could be going wrong? Thanks in advance!
-
Hi Daniel - Are you using htaccess to handle your redirects. I think you'll need to employ some Regular Expressions to handle what you're trying to accomplish. As a guide, here is a very nice writeup on RegEx from - where else - SEOmoz: http://www.seomoz.org/blog/an-seos-guide-to-regex
so, in this case, i think what you'll want is:
RewriteEngine On
**RewriteRule ^widgets/?$ reviews/widgets [NC]**so, the caret (^) ensures that the url starts with widgets, while the dollar sign ensures that the redirect rule stops there (eliminating that pesky problem you encountered with the review pages also getting redirected). The ? just means that the trailing slash is optional.Hope that helps. If this solution isn't feasible, you could always hedge with rel="canonical" on the mydomain.com/widgets page and have that point to the proper page. That will at least help with Google.-Jason
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
-
I need help on how best to do a complicated site migration. Replacing certain pages with all new content and tools, and keeping the same URL's. The rest just need to disappear safely. Somehow.
I'm completely rebranding a website but keeping the same domain. All content will be replaced and it will use a different theme and mostly new plugins. I've been building the new site as a different site in Dev mode on WPEngine. This means it currently has a made-up domain that needs to replace the current site. I know I need to somehow redirect the content from the old version of the site. But I'm never going to use that content again. (I could transfer it to be a Dev site for the current domain and automatically replace it with the click of a button - just as another option.) What's the best way to replace blahblah.com with a completely new blahblah.com if I'm not using any of the old content? There are only about 4 URL'st, such as blahblah.com/contact hat will remain the same - with all content replaced. There are about 100 URL's that will no longer be in use or have any part of them ever used again. Can this be done safely?
Intermediate & Advanced SEO | | brickbatmove1 -
Site under attack from Android SEO bots - expert help needed
For last 25 days, we are facing a weird attack on our site. We are getting 10x the normal mobile traffic - all from Android, searching for our name specifically. We are sure that this is not authentic traffic as the traffic is coming from Organic searches and bouncing off. Initially, we thought this was a DDoS attack, but that does not seem to be the case. It looks like someone is trying to damage our Google reputation by performing too many searches and bouncing off. Has any one else faced a similar issue before? What can be done to mitigate the impact on site. (FYI - we get ~2M visits month on month, 80% from Google organic searches). Any help would be highly appreciated.
Intermediate & Advanced SEO | | KJ_AV0 -
Help! Rankings dropping after optimising
I have been using MOZ a lot, in the past I have always been able to optimise a website enough to rank well in my local areas, but lately every time I optimise a website based on MOZ recommendations the rankings are just dropping and dropping... I haven't focused any efforts on backlinks, but a few sites have gone from the first page of SERP to 2nd and continue to drop... I have 2 example sites: https://www.documentmanagementsoftware.com.au/ - optimised for "Document Management Software" - was initially ranked no.7 in google AU, now it is no.16 after my efforts. http://www.tmphysio.com.au/ - optimised for "canberra physiotherapy" - was no.6 now it is dropping to no.9 after 'optimisation' Any help or insights would be extremely helpful as I feel hopeless!
Intermediate & Advanced SEO | | thinkLukeSEO0 -
Hundreds of 301 Redirects. Remove Pages or Not?
Hi Mozers, I have a website that has literally got hundreds of 301 redirects. I had a close look at these URLs and only some of them have backlinks to it and remaining all of them are not indexing in Google and has got not backlinks at all. Based on what I have noticed experts mentioning, loads of 301 redirects can potentially slow down the site speed. In a case like the website I have, should I completely take off the pages from website to reduce the number of 301 redirects or should I leave 301 redirects? There is no traffic or backlinks coming from these URLs. Malika
Intermediate & Advanced SEO | | Malika10 -
301 issues
Hi, I have this site: www.berenjifamilylaw.com. We did a 301 from the old site: www.bestfamilylawattorney.com to the one above. It's been several weeks now and Google has indexed the new site, but still pulls the old one on search terms like: Los Angeles divorce lawyer. I'm curious, does anyone have experience with this? How long does it take for Google to remove the old site and start serving the new one as a search result? Any ideas or tips would be appreciated. Thanks.
Intermediate & Advanced SEO | | mrodriguez14400 -
Need Perfect URLs
I'm redesigning a site's structure from the ground up, and am having issues with the URLs. I'd love to have them be perfect, but kept finding conflicting advice online. 1. For my services blog, is it best to have it set up like www.example.com/services/keyword or
Intermediate & Advanced SEO | | Stryde
www.example.com/keyword There seems to be conflicting advice as to keep it short and keep the keyword as far to the left as possible, but also that including the word services would help with long tail phrases and site organization. 2. For my blog section, is it best to have it set up like
www.example.com/blog/keyword or
www.example.com/keyword or
www.example.com/blog-post-title-with**-keyword**-in-it It's similar to the first question, but also adds the question of including the entire post title in the URL or just the keyword. Your help would be greatly appreciated!1 -
Help Needed With .htaccess RewriteRule
Hello Fellow Mozzers, I would really appreciate a little help as I have been banging my head against a wall for the last few hours trying to create a .htaccess RewriteRule. I have around 300 URLs that I need to 301 redirect following a site re-build, they are in groups of similar urls but infortunately not broken down in to folders. Here is an example of a few URLs:- https://www.domain.co.uk/chamaecyparis-lawsoniana-ellwoodii_2.htm
Intermediate & Advanced SEO | | AdeLewis
https://www.domain.co.uk/chamaecyparis-lawsoniana-ellwoodii-200225cm-6670.htm
https://www.domain.co.uk/chamaecyparis-lawsoniana-ellwoodii.htm
https://www.domain.co.uk/chamaecyparis-lawsoniana-ellwoods-gold.htm
https://www.domain.co.uk/chamaecyparis-lawsoniana-lemon-queen.htm
https://www.domain.co.uk/chamaecyparis-lawsoniana-yvonne-200cm-66.htm All of the above URLs need to redirect to a new URL:- http://www.domain.co.uk/chamaecyparis-lawsoniana Here is the RewriteRule that I currently have but it isn't working:- RewriteEngine On
RewriteRule ^(.*)_chamaecyparis-lawsoniana$ https://www.domain.co.uk/chamaecyparis-lawsoniana [R=301,L] Anyone have any suggestions? Thanks
Ade.0 -
Canonical tag vs 301
What is the reason that 301 is preferred and not rel canonical tag when it comes to implementing redirect. Page rank will be lost in both cases. So, why prefer one over the other ?
Intermediate & Advanced SEO | | seoug_20050