Mod Rewrite question to prevent duplicate content
-
Hi,
I'm having problems with a mod rewrite issue and duplicate content
On my website I have
Both #1 and #2 are the same page (I can't change this). #3 is different pages.
How can I use mod rewrite to to make #2 redirect to #1 so I don't have duplicate content WHILE #3 still works?
-
Unfortunately, I'm not an expert on rewriterule.
Would it be: RewriteRule ^/directory$ / http://www.website.com [R=301,L]
-
Hi again,
I think the line of code below will create the 301 Redirect that you need:
RewriteRule ^/dir$ / [R=301,L]
Let me know if you come across any more problems with it.
Hope that helps,
Sha
-
Hello,
My site is not built on a CMS but uses cakephp extensively
I am not using 301 redirect.
Regards
-
Hi kat2,
Hmmm...clearly, I should have slept before answering this , as I completely overlooked the fact that your second URL is actually a directory, so please ignore the first part of my original response (now removed), which would only work if you have a specific file to edit.
Now to mod rewrite. I'm getting a sense that something else might be in play here, as your question suggests you have already tried to create a redirect and had problems.
A couple of questions we need answered in order to get this answer right for you:
-
Is your site built on a CMS such as Joomla? Some CMS use their own redirect rules to rewrite URL's and these will overwrite the rules you write in .htaccess
-
Are you using a 301 Redirect rule, or just URL rewriting?
- To create a 301 Redirect, your rewrite rule must end with [R=301] or [R=301,L] if it is the last.
If you can answer these questions we will be better able to help sort the problem for you.
Hope that helps,
Sha
-
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
-
Duplicate content for vehicle inventory.
Hey all, In the automotive industry... When uploading vehicle inventory to a website I'm concerned with duplicate content issues. For example, 1 vehicle is uploaded to the main manufacturers website, then again to the actual dealerships website & then again to Craigslist & even sometimes to a group site. The information is all the same, description, notes, car details & images. What would you all recommend for alleviating duplicate content issues? Should I be using the rel canonical back to the manufacturers website? Once the vehicle is sold all pages disappear. Thanks so much for any advice.
Technical SEO | | DCochrane0 -
Why are these two URLs showing in Moz as duplicate content?
Here is the first URL - http://www.flagandbanner.com/Products/FBPP0000012376.asp Here is the 2nd URL - http://www.flagandbanner.com/Products/flag-spreader.asp Granted I am new to this issue on this website, but what is Roger seeing that I'm not? A lot of our duplicate pages are just like this example.
Technical SEO | | Flaglady0 -
Is this dangerous (a content question)
Hi I am building a new shop with unique products but I also want to offer tips and articles on the same topic as the products (fishing). I think if was to add the articles and advice one piece at a time it would look very empty and give little reason to come back very often. The plan, therefore, is to launch the site pulling articles from a number of article websites - with the site's permission. Obviously this would be 100% duplicate content but it would make the user experience much better and offer added value to my site as people are likely to keep returning even when not in the mood to purchase anything; it also offers the potential for people to email links to friends etc. note: over time we will be adding more unique content and slowly turning off the pulled articled. Anyway, from an seo point of view I know the duplicate content would harm the site but if I was to tell google not to index the directory and block it from even crawling the directory would it still know there is duplicate content on the site and apply the penalty to the non duplicate pages? I'm guessing no but always worth a second opinion. Thanks Carl
Technical SEO | | Grumpy_Carl0 -
Duplicate content
I have just ran a report in seomoz on my domain and has noticed that there are duplicate content issues, the issues are: www.domainname/directory-name/ www.domainname/directory-name/index.php All my internal links and external links point to the first domain, as i prefer this style as it looks clear & concise, however doing this has created duplicate content as within the site itself i have an index.php page inside this /directory-name/ to show the page. Could anyone give me some advice on what i should do please? Kind Regards
Technical SEO | | Paul780 -
Duplicate Page Content
Hi within my campaigns i get an error "crawl errors found" that says duplicate page content found, it finds the same content on the home pages below. Are these seen as two different pages? And how can i correct these errors as they are just one page? http://poolstar.net/ http://poolstar.net/Home_Page.php
Technical SEO | | RouteAccounts0 -
Duplicate content check picking up weird urls
Hi everyone, I love the duplicate content feature; we have a lot of duplicate content issues due to the way our site is structured. So, we're working on them. However, I'm not fully understanding the results. For example, say I have an article on breast cancer symptoms. It shows up as duplicate content, by having two urls that point to the exact same page. http://www.healthchoices.ca/articles/breast cancer symptoms and http://www.healthchoices.ca/somerandomstringofcode. I fully understand why that is duplicate content. I am not sure about this though, it picks up the same url twice and calls it duplicate content. For example, saying that http://www.healthchoices.ca/dr.-so-and-so and http://www.healthchoices.ca/dr.-so-and-so is duplicate...however is this not the same page? Is there something I'm missing? Many of the URL's are identical. Thanks, Erin
Technical SEO | | erinhealthchoices0 -
Mod Rewrite Help
I need some help with doing the Mod Rewrite on our htaccess file. Basically I've a URL like this : www.example.co.uk/new-toy-search?keys=xbox and I want to rewrite the URL into something else (such as new-toy-search-xbox.html) Could someone please take me through the steps of how to do this? I've had a look at the Apache site but it's really confusing the way it's explained!
Technical SEO | | DanHill0 -
CGI Parameters: should we worry about duplicate content?
Hi, My question is directed to CGI Parameters. I was able to dig up a bit of content on this but I want to make sure I understand the concept of CGI parameters and how they can affect indexing pages. Here are two pages: No CGI parameter appended to end of the URL: http://www.nytimes.com/2011/04/13/world/asia/13japan.html CGI parameter appended to the end of the URL: http://www.nytimes.com/2011/04/13/world/asia/13japan.html?pagewanted=2&ref=homepage&src=mv Questions: Can we safely say that CGI parameters = URL parameters that append to the end of a URL? Or are they different? And given that you have rel canonical implemented correctly on your pages, search engines will move ahead and index only the URL that is specified in that tag? Thanks in advance for giving your insights. Look forward to your response. Best regards, Jackson
Technical SEO | | jackson_lo0