We have set up 301 redirects for pages from an old domain, but they aren't working and we are having duplicate content problems - Can you help?
-
We have several old domains. One is http://www.ccisound.com - Our "real" site is http://www.ccisolutions.com The 301 redirect from the old domain to the new domain works. However, the 301-redirects for interior pages, like:
http://www.ccisolund.com/StoreFront/category/cd-duplicators do not work. This URL should redirect to http://www.ccisolutions.com/StoreFront/category/cd-duplicators but as you can see it does not.
Our IT director supplied me with this code from the HT Access file in hopes that someone can help point us in the right direction and suggest how we might fix the problem:
RewriteCond%{HTTP_HOST} ccisound.com$ [NC]
RewriteRule^(.*)$ http://www.ccisolutions.com/$1 [R=301,L]
Any ideas on why the 301 redirect isn't happening? Thanks all!
-
Yes, That is the best thing you can do. Because seems there have some other issues in configs. And we can not see from here about your all the configs. Anyway the codes we have given you will successfully work once you solve your other problems.
Best Regards
Prasad
-
Thanks Prasad for all your help. And thank you to Ersin also. We have solved the problem. Apparently, our URL re-write at the TomCat level was taking precedence over the .htaccess file. Once our IT director added the appropriate redirect for these domain pages into the URL re-write file, the problem was fixed and those pages now render with a 301-redirect to the correct page one the correct domain. I have encouraged him to write a blog post about this and put it here because there was very little documentation online about TomCat redirects tasking precedence over an .htaccess file.
-
Thanks Prasad,
We tried your suggestion because there was a lot of stuff [1220 lines of code] in our .htaccess file. We stripped everything out except your code, and still had the same problem. Our IT director is wondering if perhaps there is a conflict between the .htaccess file that operates at the Apache level and the URL rewirte file which operates at the TomCat level. He is wondering, does one of them take precedence over the other? In other words, could our URL re-write file be causing the redirects in the .htaccess file to not work properly?
I am thinking maybe we need to hire someone to look at the code in both files in order to figure out where and why we are having a conflict?
Dana
-
Hi,
I think you are doing so many mistakes. First take out all the other codes from your .htaccess file. Then copy only one code from me or from Ersin. While you have some other codes related to this domains redirection there may have conflicts. And your current code work for your root domains mean your .htaccess redirection is working. The problem is you have not used it correctly.
-
Thanks to both Ersin and Prasad. I appreciate your efforts to help very much. My IT director tried both versions of code without success. Here is exactly what he wrote:
" I tried the suggestions without success. I even moved the ccisound
redirects to the top of the file thinking that some other redirect was grabbing
it first, But no go, same results. Top level redirected, lower level not."Any suggestions as to why neither code succeeded at creating a "catch all." ?
-
cprasad's and my purpose are same, so our responses will work. But just some diffrences;
"<ifmodule mod_rewrite.c="">" line checks wheter Apache's rewrite module is activated or not. If it is then it runs the code after that. The second one is that my rewritecond lines are less than cprasad's, but they all same conditions.By the way, i have just tested it before I wrote it.</ifmodule>
Just do it..
-
Hi,
Do not worry about the differences about the code provided by me and by Ersin. Both are same in functioning. He have just added module activation tags in to the code. So you may use any code which you prefer and works for you.
And the answer for your question about the code you were using, it may not be initiate a wildcard redirection.
Are there more codes inside the .htaccess?
If you can post the exact code without hyper-linking any url then I can tell you the exact reason why your code does not do the job.
Prasad
-
Thanks Ersin,
Can you explain how your coding suggestion is different from Prasad's? I am not a coder so am just wondering if there's a different methodology behind the two suggestions?
-
Yes, a catch-all makes sense to me. what is the difference between your code suggestion and the one just below posted by Ersin A. ? Also, just for our own understanding, can you explain why the code we were using wasn't accomplishing what we wanted? (I just want to be able to explain it to our Web team). Thanks!
-
Hi,
The supplied url for interior page of old domain which you have mentioned not redirecting seems not correct. Because you have linked that text with the new domain. Anyway I have understand your problem. Your problem is
is redirecting to
but
http://www.ccisound.com/StoreFront/category/cd-duplicators
is not redirecting to
http://www.ccisolutions.com/StoreFront/category/cd-duplicators
If I have understood correctly, the solution for your problem is, Do a wildcard 301 redirection. It will redirects all the inner pages to the new domain's inner pages. But all the inner pages in new site, must have the same paths as the old site. Hope you understand what I mean.
Anyway when look in to the example urls you have provided it seems both sites have the same content. So there is nothing to worry about. Seems you have just changed domain name.
So anyway use the following code in your .htaccess file inside your root folder
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^ccisound.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.ccisound.com$
RewriteRule ^(.*)$ "http://www.ccisolutions.com/$1" [R=301,L]First and second line do not write again if those already written inside your .htaccess file.
the above code will initiate a wildcard 301 redirection and will solve your problem. Hope you can improve the code for all the other domains you have. Otherwise post here. I will do it for you.
Regards
Prasad
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
-
Specific pages won't index
I have a few pages on my site that Google won't index, and I can't understand why. I've looked into possible issues with Robots, noindex, redirects, canonicals, and Search Console rules. I've got nothing. Example: I want this page to index https://tour.franchisebusinessreview.com/services/franchisee-satisfaction-surveys/ When I Google the full URL, I get results including the non-subdomain homepage, and various pages on the subdomain, including a child page of the page I want, but not the page itself. Any ideas? Thanks for the help!
Technical SEO | | ericstites0 -
How to redirect old domain to new domain.
We just recently signed up to Moz with hopes of fixing our Moz Ranking. We have an old domain - http://at-net.net and a new domain - https://www.expertip.net We have set up 301 (Permanent) redirects from all pages on the old site to the new, but aren't getting the ranking or aren't getting recognized from external links to the old sites. I've read the moz article on 'Link Juice' and followed those practices, but it doesn't seem to help. Does anyone have advice on doing this? Thanks in advance,
Technical SEO | | greg.lanier
Greg0 -
Is there ever a time when 301 redirects aren't possible?
I have been told that 301 redirects are always possible. I've been told that it's a very time consuming process so developers at times will say that it's not possible. Is there ever a time when it is not impossible? Perhaps using a specific server? I know it's do-able in Apache which is the server that is in question. Would it be impossible if someone were using a templated type set of websites & if they made changes on one website it would make changes across all websites? *Edit "due to a server configuration 301 redirects aren't possible" Thanks so much for any help or answers you can provide.
Technical SEO | | DCochrane0 -
Why aren't certain links showing in SEOMOZ?
Hi, I have been trying to understand our page rank and domains that are linking to us. When I look at the list of linking domains, I see some bigger ones are missing and I don't know why. For example, we are in the Yahoo Directory with a link to trophycentral.com, but SEOMOZ is not showing the link. If SEOMOZ is not seeing it, my guess is Google is not either, which concerns me. There are several onther high page rank domains also not showing. Anyone have any idea why? Thanks! BTW, our domain is trophycentral.com
Technical SEO | | trophycentraltrophiesandawards0 -
Setting up a 301 redirect from expired webpages
Hi Guys, We have recently created a new website for one of our clients and replaced their old website on the same domain. One problem that we are having is that all of the old pages are indexed within Google (1000s) and are just getting sent to our custom 404 page. We are finding that there is an large bounce rate from this and also, I am worried from an SEO point of view that the site could lose rank positioning through the number of crawl errors that Google is getting. Want I want is to set up a 301 redirect from these pages to go to the 'our brands' page. The reason for this is that the majority of the old URLs linked to individual product pages, and one thing to note is that they are all .asp pages. Is there a way of setting up a rule in the htaccess file (or another way) to say that all webpages that end with the suffix of .asp will be 301 redirected to the our brands' page? (there is no .asp pages on the new site as it is all done in php). If so, I would love it if someone could post the code snippet. Thanks in advance guys and if you have any other ideas then be my guest to suggest 🙂 Matt.
Technical SEO | | MatthewBarby0 -
Duplicate Home Page content and title ... Fix with a 301?
Hello everybody, I have the following erros after my first crawl: Duplicate Page Content http://www.peruviansoul.com http://www.peruviansoul.com/ http://www.peruviansoul.com/index.php?id=2 Duplicate Page title http://www.peruviansoul.com http://www.peruviansoul.com/ http://www.peruviansoul.com/index.php?id=2 Do you think I could fix them redirecting to http://www.peruviansoul.com with a couple of 301 in the .htaccess file? Thank you all for you help. Gustavo
Technical SEO | | peruviansoul0 -
SEOMoz Crawl Diagnostic indicates duplicate page content for home page?
My first SEOMoz Crawl Diagnostic report for my website indicates duplicate page content for my home page. It lists the home page URL Page Title and URL twice. How do I go about diagnosing this? Is the problem related to the following code that is in my .htaccess file? (The purpose of the code was to redirect any non "www" backlink referrals to the "www" version of the domain.) RewriteCond %{HTTP_HOST} ^whatever.com [NC]
Technical SEO | | Linesides
RewriteRule ^(.*)$ http://www.whatever.com/$1 [L,R=301] Should I get rid of the "http" reference in the second line? Related to this is a notice in the "Crawl Notices Found" -- "301 Permanent redirect" which shows my home page title as "http://whatever.com" and shows the redirect address as http://http://www.whatever.com/ I'm guessing this problem is again related to the redirect code I'm using. Also... The report indicates duplicate content for those links that have different parameters added to the URL i.e. http://www.whatever.com?marker=Blah Blah&markerzoom=13 If I set up a canonical reference for the page, will this fix this? Thank you.0 -
Seomoz is showing duplicate page content for my wordpress blog
Hi Everyone, My seomoz crawl diagnostics is indicating that I have duplicate content issues in the wordpress blog section of my site located at: http://www.cleversplash.com/blog/ What is the best strategy to deal with this? Is there a plugin that can resolve this? I really appreciate your help guys. Martin
Technical SEO | | RogersSEO0