Mixed content - SSL http/https issue - wordpress

Approximately 2 months ago I installed a SSL certificate on my site, catherinerushforth.com. I changed the site and WordPress URL in the admin area of WordPress to include https:// instead of http://. All was fine.
Then, about 2 weeks ago I started to have a problem with "Mixed Content" errors on all pages except the main home page. There doesn't seem to be an issue when viewing the site with Safari but there is a problem with Chrome, Firefox and Internet Explorer. I inspected the Javascript console in Chrome (as an example) and saw multiple "Mixed Content" errors
This is what I have do so far to try and fix these mixed content errors:
Changed http:// to https:// in the WordPress Admin section for the site and WordPress URLs (Settings/General)
I've added "define('FORCE_SSL_ADMIN', true);" to the top of the wp-config.php file.
I've added the following piece of code to the .htaccess file:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^catherinerushforth.com [NC]
RewriteRule ^(.*)$ https://catherinerushforth.com/$1 [L,R=301]
With this code I get "ERR_TOO_MANY_REDIRECTS"
I've also tried the plugin, WordPress HTTPS (SSL).
None of the above have worked.
Does anyone know what I am doing wrong and/or have any suggestions as to how I can fixed this issue?
Many thanks.
WordPress version: 4.2.2
Theme: X-theme v.4 (although issue was the same in previous version of this theme)
Site: catherinerushforth.com
UPDATE
If I simply remade each page for my site (which I will probably have to do at some point due to X-Theme now using their CornerStone page builder) would this ensure all links were https:// and not http://?

Remove
define('FORCE_SSL_ADMIN', true);
from wp-config.php, be sure you have changed http:// to https:// in WordPress Admin, and then force SSL for front and backends with this in .htaccess above the WordPress rewrite block:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://catherinerushforth.com/$1 [R=301,L]
That only forces SSL; you still need to find the site resources which are loading non-SSL.
So use the developer tools in Firefox (or Firebug) or Chrome or Safari or IE to see the errors with specific site resources.
And:
• you should change URLs of media items and links in the post/page content to https so they don't depend on the redirect in .htaccess. Search RegEx is a good plugin to be able to search and replace (optionally with grep) through all posts, pages, excerpts, comments, titles and meta. And, interconnectit.com WordPress Serialized PHP Search Replace Tool can be used to find/replace in the entire database, i.e. metadata, GUIDs and widget content, etc.
• You may need to change to a relative path for images in CSS files, i.e. background-image: url(http://example.com/themes/wp-content/theme/images/image.jpg) to background-image: url(images/image.jpg)
• You may need to remove the http from absolute paths in php theme files, i.e. change 'http://example.com/image.jpg' to '//example.com/image.jpg'; that will allow your resources to default to https.

RewriteEngine On
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
Source

So I had this issue on image urls being returned as http://https://website.com/image.jpg. What I did was use the Velvet URL plugin to rewrite the urls for all content from http://https://websiteurl to https://websiteurl. This fixed the issue for me. Cheers

Using ubuntu 16.04, letsencrypt, nginx, apache2, wordpress. For me
1. adding redirect in `/etc/apache2/sites-enabled/000-default.conf` didn't work (too many redirects)
2. adding RewriteRule in .htaccess didn't work (too many redirects)
Finally I installed really-simple-ssl plugin from wordpress and it worked like charm.

Related

non wodpress subdirectory refusing to serve https content

Runnin landing pages in a subdirectory below wordpress install;
public_html/comms
https pages in /comms display but scripts, css and images wont display.
If I remove the s and leave http then they will display perfectly within a https page. How strange.
This only began a few days ago and only happens in chrome.
Works fine with edge and ie.
I need these landng pages to be https and no mixed content because google will penalise my quality score and adds will be more expensive.
I am lost for ideas.
Chrome problem only
In the subfolder only
Any thoughts?
Have you setup forced SSL in the .htaccess file in the subdirectory root?
Add this to the file if it isn't there:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

.htaccess wordpress multisite redirect between subsites

I am building a new site for a client. we preserved the old site in a wordpress multisitesolution. Now it's time to migrate into the new site. Problem is the old site is heavilly embedded in Google Search with many active links. So I need a way to catch and redirect each and every link that comes our way.
I can redirect old.sitename.com to new.sitename.com directly - this works fine. Problem is when I get direct links to posts or pages.
Som this is the syntax I need resolved
old.sitename.com/an-article-read-this --> new.sitename.com/an-article-read-this
I have tried several .htaccess commands, including a few wordpress addons. Even simple ssl with .htaccess redirect enabled.
RewriteRule ^old.*$\% https://hoppla.heiledeg.no/%{REQUEST_URI} [R=302,NC]
direct links keeps opening up in the old site. not the new one.
Yes I have refreshed cache. And even tested on "fresh" browsers.
Any ideas, tips, or even addons are very much appreciated.
for me this was the solution:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(old.)?olddomain.com$ [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301]

How do I make the landing page of website appear on Google and not "Index of /"?

I have recently made my WordPress website live and want it to be visible on Google Search. However, when specifically searching for the website, Google does not show the site title or description entered in WordPress, but rather "Index of /" and a bit of server info as the page summary. Does anyone recognize this, and have some ideas on how to fix this?
Apache2 is running on an Ubuntu 18.04 server and everything is updated. I have both an index.html file and obviously an index.php file in the DocumentRoot directory specified in the Virtual Host file for apache. And have specified to use index.php first in the .htaccess file. I've also tried to add the URL of the page to Google Search Console and added a sitemap, but with no effect.
You can add these lines to .htaccess files (its located in root of the website). What it does its redirects any trafic you got on http://example.com to https://example.com Please check both locations in separate browsers (and again with removed cache) on how it works. SOmetimes apache can be configured so it wouldn't work out of the box (like it can require additional fixes to redirection code or to the additional blocks etc...)
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

HTTPS on dev server - issues

I copied a live woocommerce site back to the dev server. The live site uses https. So when I tried accessing it on the dev server, it redirected me to the live site. I figured the issue was the .htaccess file. I tried editing it, but the file is encrypted. So I just removed it all together. That stopped the redirecting, and I was able to access the front-end of the dev site. However when I try to access the wp-admin or wp-login.php I get a 404. I also noticed that the broswer changed from http to https. So there's something still trying to make the website run under https.
What I've tried:
I deactivated woocommerce plugin (by renaming it) but that didn't
help.
I also searched in the database for instances of https:// but I
could not find any that related to the website.
I also found and removed a cert.html file in the root which I think
it's related to the https certification, but I still can't access
the backend.
And last, I tried to add a new .htaccess file with the basic
wordpress permalinks in it, but that just gave 500 server errors.
Can anyone give some pointers where to look? Or what could be causing the browser to use https, instead of http.
It looks like you need to change your site URL to point to the right place. Since you can't log in (it'll redirect you to the wrong site URL), you need to change this in your wp-config.php file (see this link for more info):
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
After that, and hopefully with the default wordpress rules, you should be able to log in to the admin pages.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
The above assumes that your wordpress site is at /.

Why Won't Fishpig Set the Magento Blog URL Correctly?

So, a client of mine has this Magento site set up:
http://kharmakhare.com
I have actually asked a question about this site before. This time, they want a blog set up at:
http://kharmakhare.com/blog
Yes, there is one already there. They want to replace that AW Blog with a Wordpress blog integrated into the Magento theme with Wordpress. There's just one problem; I can't get the url to change at ALL.
No matter what I do, the blog always appears at:
http://kharmakhare.com/wordpress
I try to disable the AW Blog and test the new one at:
http://kharmakhare.com/blog
But nothing happens. The above url simply redirects to the main site.
All of my Wordpress Integration settings are green (except for "improve your blog"). If I disable Wordpress Integration in the settings, the /wordpress directory STILL appears.
In Wordpress, the site url is set to /blog. The wordpress url is /wp. Whenever I try changing the permalink settings Wordpress fails to create the .htaccess file, so I did it manually... but it always uses /blog in the settings:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
Not that it matters much. Even with it set to:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp/index.php [L]
</IfModule>
It still doesn't work.
This has been a real, real pain to set up. The documentation says its easy, everything I've read says its easy. It just plain won't work for me. I even tried reinstalling the plugin. Then I tried uninstalling and reinstalling the plugin. I also tried (before this) uninstalling and reinstalling wordpress. Nothing works.
I can NOT delete the AW blog without having the new blog to replace it. I can disable the AW blog temporarily, but I can't delete it. Is there anything that I'm missing?
Any help would be greatly appreciated.
Firstly, upgrade WordPress Integration to the latest version and uninstall AheadWorks Blog extension.
Secondly, I assume that you have installed WordPress in a sub-directory other than 'blog'. For this example, I will assume you have installed it in 'wp'.
To make your blog viewable on /blog, set your Blog Route as 'blog' and your WordPress path as 'wp'. Next, login to WordPress and select Settings > General and change the second URL option (labelled Site address (URL)) to http://www.yourmagentourl.com/blog
You should now be able to view your blog at the /blog URL.
Finally, if WordPress is installed in /wp and visible at /blog, your .htaccess file should reference /wp/ and not /blog
The solution is easy. First fully disable AW_Blog. Don't just disable this via the configuration or via System > Advanced. Either fully uninstall it or delete the app/etc/modules/AW_Blog.xml file and then refresh the cache.
The AW_Blog module uses - rather selfishly - 'blog' as it's frontName. The frontName takes precendence over the dynamic routing system used in Magento WordPress Integration so while AW_Blog is installed, you can't use 'blog' as your WordPress URL.
With AW_Blog fully uninstalled, enter 'blog' as the blog route in the extensions configuration. Finally, login to the WordPress Admin and select Settings > General. Here you will see 2 URLs. The first URL should be the true WordPress URL (if WordPress is installed at /wp then this should be the /wp URL). The second URL should be the integrated Magento URL (eg. the /blog URL)
The WordPress .htaccess file has no effect as this only runs when actually accessing WordPress and isn't ran when accessing Magento.
Hi this is more of a question clarification (disclaimer) as I am having what may be a related issue.
What happens when you visit http://WWW.kharmakhare.com/blog rather than the shorter url? For me at the moment- www.magento.com/blog resolves correctly whereas magento.com/blog sends me to the home page.
Also, have you tried setting the full path in the wordpress settings? Your question indicates you have set it to /blog rather than the full http://kharmakhare.com/blog ? I believe it should include the full file path.
Ok, I think this must be a bug in the plugin. The ONLY way I could get this to work is to edit the Fishpig plugin's core so that the default route is "blog."
Not an ideal solution, but at least it works. This should not be such a problem, though, the plugin should work as its intended without modifying the core files.
when dealing with the Wordpress plugin, be sure to clean magento cache (better disable it during editing) and clear your browser cache as well.
Changing routes around between magento and the Wordpress plugin, quickly becomes a nightmare when dealing with invalid caches.
Also check your URL rewites as sometimes as a last resort, a webshop owner will use this to make things work.

Resources