After adding a ssl certificate to my site I encountered problems with duplicate pages and page titles
-
Hey everyone!
After adding a ssl certificate to my site it seems that every page on my site has duplicated it's self. I think that is because it has combined the www.domainname.com and domainname.com. I would really hate to add a rel canonical to every page to solve this issue. I am sure there is another way but I am not sure how to do it. Has anyone else ran into this problem and if so how did you solve it?
Thanks and any and all ideas are very appreciated.
-
Hi Donford,
Excuse the delay. We have been very busy but we are working on updating our .htaccess file. Thank you for the quick response. We will let you know if it resolves our issues.
-
**`Don is right If on Nginx use`**
<code>server { server_name [example.com](http://example.com/); rewrite ^/(.*) [https://example.com/$1](https://example.com/$1) permanent; }</code>
<code>server { listen 80; server_name my.domain.com; return 301 https://$server_name$request_uri; } server { listen 443 ssl; server_name my.domain.com; [....] }</code>
<code>server { listen 80; server_name yourdomain.com www.yourdomain.com; return 301 https://$server_name$request_uri; } server { listen 443 ssl spdy; server_name yourdomain.com www.yourdomain.com; ssl on; ssl_certificate /var/www.yourdomain.com/cert/ssl-bundle.crt; ssl_certificate_key /var/www/yourdomain.com/cert/yourdomain.com.key; access_log /var/log/nginx/yourdomain.com.access.log rt_cache; error_log /var/log/nginx/yourdomain.com.error.log; root /var/www/yourdomain.com./htdocs; index index.php index.htm index.html; include common/wpfc.conf; include common/wpcommon.conf; include common/locations.conf; }</code>
`https://christiaanconover.com/blog/how-to-redirect-http-to-https-in-nginx`
https://moz.com/learn/seo/redirection
https://wp-mix.com/htaccess-redirect-http-to-https/
https://www.digitalocean.com/community/questions/http-https-redirect-positive-ssl-on-nginx
-
HI Travis
Yes, you can use your .htaccess file to fix this. (This file should be located in your home directory)
A simple example would be
RewriteEngine On
RewriteCond %{HTTP_HOST} ^YourDomain.com
RewriteRule ^(.*)$ http://www.YourDomain.com/$1 [R=301,L]What this does is looks for any request for non-www urls, if found it 301 redirects it to the www version of the page.
Hope this helps,
Don
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
-
Site structure for location + services pages
We are in the process of restructuring our site and are trying to figure out Google's preference for location pages and services. Let's say we are an auto repair company with lots of locations and each one of them offer some unique services, while other services are offered by all or most other locations. Should we have a global page for each service live with a link to the location page for each shop that offers that service? OR Should we built a unique page about each service for every location as a subfolder of each location (essentially creating a LOT of sub pages because each location has 15-20 services. Which will rank better?
Intermediate & Advanced SEO | | MJTrevens1 -
If a page ranks in the wrong country and is redirected, does that problem pass to the new page?
Hi guys, I'm having a weird problem: A new multilingual site was launched about 2 months ago. It has correct hreflang tags and Geo targetting in GSC for every language version. We redirected some relevant pages (with good PA) from another website of our client's. It turned out that the pages were not ranking in the correct country markets (for example, the en-gb page ranking in the USA). The pages from our site seem to have the same problem. Do you think they inherited it due to the redirects? Is it possible that Google will sort things out over some time, given the fact that the new pages have correct hreflangs? Is there stuff we could do to help ranking in the correct country markets?
Intermediate & Advanced SEO | | ParisChildress1 -
404 Pages. Can I change it to do this without getting penalized ? I want to lower our bounce rate from these pages to encourage the user to continue on the site
Hi All, We have been streaming our site and got rid of thousands of pages for redundant locations (Basically these used to be virtual locations where we didn't have a depot although we did deliver there and most of them was duplicate/thin content etc ). Most of them have little if any link value and I didn't want to 301 all of them as we already have quite a few 301's already We currently display a 404 page but I want to improve on this. Current 404 page is - http://goo.gl/rFRNMt I can get my developer to change it, so it will still be a 404 page but the user will see the relevant category page instead ? So it will look like this - http://goo.gl/Rc8YP8 . We could also use Java script to show the location name etc... Would be be okay ? or would google see this as cheating. basically I want to lower our bounce rates from these pages but still be attractive enough for the user to continue in the site and not go away. If this is not a good idea, then any recommendations on improving our current 404 would be greatly appreciated. thanks Pete
Intermediate & Advanced SEO | | PeteC120 -
Javascript to fetch page title for every webpage, is it good?
We have a zend framework that is complex to program if you ask me, and since we have 20k+ pages that we need to get proper titles to and meta descriptions, i need to ask if we use Javascript to handle page titles (basically the previously programming team had NOT set page titles at all) and i need to get proper page titles from a h1 tag within the page. current course of action which we can easily implement is fetch page title from that h1 tag being used throughout all pages with the help of javascript, But this does makes it difficult for engines to actually read what's the page title? since its being fetched with javascript code that we have put in, though i had doubts, is anyone one of you have simiilar situation before? if yes i need some help! Update: I tried the JavaScript way and here is what it looks like http://islamicencyclopedia.org/public/index/hadith/id/1/book_id/106 i know the fact that google won't read JavaScript like the way we have done with the website, But i need help on "How we can work around this issue" Knowing we don't have other options.
Intermediate & Advanced SEO | | SmartStartMediacom0 -
Duplicate Content and Titles
Hi Mozzers, I saw a considerable amount of duplicate content and page titles on our clients website. We are just implementing a fix in the CMS to make sure that these are all fixed. What changes do you think I could see in terms of rankings?
Intermediate & Advanced SEO | | KarlBantleman0 -
Duplicate peices of content on multiple pages - is this a problem
I have a couple of WordPress clients with the same issue but caused in different ways: 1. The Slash WP theme which is a portfolio theme, involves setting up multiple excerpts of content that can then be added to multiple pages. So although the pages themselves are not identical, there are the same snippets of content appearing on multiple pages 2. A WP blog which has multiple categories and/or tags for each post, effectively ends up with many pages showing duplicate excerpts of content. My view has always been to noindex these pages (via Yoast), but was advised recently not to. In both these cases, even though the pages are not identical, do you think this duplicate content across multiple pages could cause an issue? All thoughts appreciated
Intermediate & Advanced SEO | | Chammy0 -
Duplicate titles but redirecting anyway (without redirects set up!!!)
Google has done a crawl of my site and is flagging up duplicate titles on my wordpress site. This appears to be due to the face that some posts are tagged in more than one category. I have just gone to make sure that each post just has one category and add redirects and I've noticed that all the duplicate title issues google has notified me about appear to redirect anyway. For example: http://www.musicliveuk.com/latest-news/live-music-boosts-australian-economy and http://www.musicliveuk.com/live-music/live-music-boosts-australian-economy have duplicate titles apparantly but the 1st url redirects to the 2nd one. I use the redirection plug in but have no redirection set up for that url so I'm a bit confused. And if they're redirecting anyway then why is google flagging up duplicate titles? Any help would be much appreciated.
Intermediate & Advanced SEO | | SamCUK1 -
Have a problem with our home page. Is temporary 301 redirect an option?
Hey Mozers, I discovered this morning that the home page for my website is rendering fine in Chrome and Firefox, but very poorly in IE. My analytics show that over 50% of my visitors are using IE. As a result of the problem, IE has a bounce rate 32% higher than other browsers. I'm not a web developer and I'm fairly new to SEO, so I'm guessing that it's going to take me at least a couple days to get it fixed. In the meantime, I was considering doing a 301 redirect from the home page to the largest category page in hopes of keeping some of the IE users from bouncing while I get the home page sorted out. Would there be any long term negative effects from this once I get the page sorted out and take the 301 off it? Are there any other solutions that would be better? Thanks for the help!
Intermediate & Advanced SEO | | matthewbyers0