mixed content - mshots - php

Since my website moved to https, I see I have a lot of mixed content because of the mshots snippet.
In includes/functions.php I tried to change the URL from http://s0.wordpress.com/mshots/v1 to https://s0.wordpress.com/mshots/v1, but then I have a new issue : half of my images disappear.
If I try to add a new shop to my site, there is no image, so it is not only affecting half of my existing stores, but also every new store I add.
Does anyone know why this is happening and how can I solve this?

If you have valid SSL certificate, than just move whole website on https, you can use this plugin: https://wordpress.org/plugins/ssl-insecure-content-fixer/

If you use Apache, put this code to your .htaccess. Now every thing go to your server will be force redirect from HTTP to HTTPS.
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Related

All Tumblr URLs pointing to my Wordpress website Broke with SSL

Last week, I transitioned my website to SSL by using a plugin called Really Simple SSL.
It all went smoothly, however, I noticed that ever since activating the plugin and going SSL, my site lost 1/3 of its traffic, which was coming from external Tumblr links on my Tumblr blog that pointed at the http version of my website.
When I click on those Tumblr links now, I get a blank page that says:
{"error":"Redirect failed"}
Here's an example of such Tumblr link would be.
(Not including my actual website's domain here cause it is an adult site).
http://t.umblr.com/redirect?z=http%3A%2F%2Fexample.com%2F&t=YmY1YWYwZTI0MmU3YmQzNzEyYmJjN2MzYjY0NjJlZDk5ZTFlN2RmMCxPTGo3TU5iOQ%3D%3D
It occured to me that those hundreds of old links all point to the http version of my site, but for some reason, they're not getting correctly redirected to https as they should be doing.
The http to https redirect definitely works every other time, but for some reason, with old Tumblr URLs it doesn't.
Any clues on what could be the cause of this?
I already tried to tweak the settings of my site, like, for example:
Adding this to my wp.config.php file:
define('FORCE_SSL_ADMIN', true);
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
$_SERVER['HTTPS']='on';
Editing .htaccess manually with these lines:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
But alas, neither seems to have worked.
Is there a way I could fix this?
Again, the HTTP to HTTPS redirects work for literally everything, except those Tumblr URLs, which are, very unfortunately, a huge source of traffic for my site.

How to force specific pages in wordpress to be non SSL (http)

Currently I have my ssl forced on a pages where it is needed and it works great.
Problem is on all other pages user can click in address bar and add "https" causing some pages to load with error about mixed content etc.
Same happens if someone visits page with https link.
How can I use either worpress functions.php or htaccess file to force specific page URL to always use non-ssl version of website?
Edit:
I just don't see how suggested duplicate is a duplicate. There is no example of any htaccess code and post author seems to mention he managed to create some solution but without code this does not help me.
What I need is what would seem simple redirect like
https://domain.com/page1 -> http://domain.com/page1
Shouldn't something like that be possible with either htaccess or just wordpress functions.php?
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} ^/someurl
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]
above seemed to work for me.
Redirects from https to http just for /someurl

using .htaccess to force some pages using non-SSL on an SSL site

I currently have a site where users can login and do various things. The site uses SSL(HTTPS).
Is there a way to use .php or .htaccess to unsecure a specific link and any link connected (ie. (https://domain.com/unsecure, https://domain.com/unsecure/randominfinit)) unsecure?
But also would this work with a user being logged in to their account and be able to navigate out of /unsecure or /unsecure/randominfinit and still be logged in and not throw errors or browser errors or reduce security?
I have been looking everywhere for a solution for this and have not been able yet to find a solution.
The reason why I need to do this is because I am using iframe to load .swf content on my secure site that is hosted on another domain/server. If you have a better idea to deliver content using iframe with non-SSL content, please tell me - I am all ears.
As long as you have a valid cert you can go between http and https. This will check if the directory is unsecure and https then redirect to non https.
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/unsecure [NC]
RewriteCond %{HTTPS} ^on
RewriteRule ^(.*) http://example.com/$1 [R=301,L]
Let me know how that works for you.

Switched hosts, having issues with .htaccess 301 redirects from old website to new website

I have a blog that was originally built on blogengine.net; I switched over to Wordpress, and changed to a different hosting company.
I'm using their Cpanel to redirect 3 or 4 pages to reflect their new URLs. Specifically, I'm trying in one instance to perm 301 redirect:
http://www.realtruthnow.org/blog/post/2013/01/01/What-do-people-in-Newtown-want-for-the-holidays
to
http://www.realtruthnow.org/ny-governor-signs-nations-first-gun-control-bill-since-newtown/
When I do this using the host's Cpanel, it creates an entry in my root .htaccess like this:
RewriteCond %{HTTP_HOST} ^realtruthnow\.org$ [OR]
RewriteCond %{HTTP_HOST} ^www\.realtruthnow\.org$
RewriteRule ^blog\/post\/2013\/01\/01\/What\-do\-people\-in\-Newtown\-want\-for\-the
\-holidays$ "http\:\/\/www\.realtruthnow\.org\/ny\-governor\-signs\-nations\-first
\-gun\-control\-bill\-since\-newtown\/" [R=301,L]
This didn't work. So I googled, and tried putting this at the bottom of the .htaccess:
Options +FollowSymLinks
RewriteEngine on
Redirect 301 /http://www.realtruthnow.org/blog/post/2013/01/01/What-do-people-
in-Newtown-want-for-the-holidays http://www.realtruthnow.org/ny-governor-signs-nations-
first-gun-control-bill-since-newtown/
That didn't work either. I only need to do this for 3 or 4 pages that I'm aware of. Does anybody know how I can accomplish this redirect from an old host to a new host, so when someone clicks the old link, they're 301'd to the new link? Any guidance would be appreciated!
Solved
I installed "simple 301 redirects" plugin, and that didn't work when I put the old URL http://www.realtruthnow.org/ in ... but when I omitted that, and just put /blog/post/2013/01/01/What-do-people-in-Newtown-want-for-the-holidays in for my old URL, BAM -- it worked! Below is the plugin if anybody needs it.
http://wordpress.org/extend/plugins/simple-301-redirects/
You could try this;
RewriteCond %{HTTP_HOST} ^realtruthnow\.org$ [OR]
RewriteCond %{HTTP_HOST} ^www\.realtruthnow\.org$
RewriteRule ^blog/post/2013/01/01/What-do-people-in-Newtown-want-for-the-holidays/?$ http://www.realtruthnow.org/ny-governor-signs-nations-first-gun-control-bill-since-newtown/ [R=301,L,NC]
It's the same rule that cPanel generated, without quotes and escaping.
It redirects permanently this
http://www.realtruthnow.org/blog/post/2013/01/01/What-do-people-in-Newtown-want-for-the-holidays
To this
http://www.realtruthnow.org/ny-governor-signs-nations-first-gun-control-bill-since-newtown/
If anybody comes across a similar problem, I solved the problem of redirecting old blogengine.net links (from a windows server) to Wordpress links with a new host.
It turns out that it's a quirky Wordpress type of thing.
I installed "simple 301 redirects" plugin, and that didn't work when I put the old ENTIRE URL http://www.realtruthnow.org/blog/post/2013/01/01/What-do-people-in-Newtown-want-for-the-holidays in ...
But when I omitted the root, and just put /blog/post/2013/01/01/What-do-people-in-Newtown-want-for-the-holidays in for my old URL, BAM -- it worked!
Below is the plugin if anybody needs it.
http://wordpress.org/extend/plugins/simple-301-redirects/

URL Problem in Ajax in PHP

When I open my site without "www", like http://mysite.com/, then there is a problem with my website hit counter on the home page, which is done through AJAX.
The problem is that counter Image is not getting displayed.
It is showing blank.
There are similar problem on other pages where I have used AJAX to retrieve data.
To the cross-domain security policy, "mysite.com" and "www.mysite.com" are different domains, therefore AJAX requests aren't allowed between them.
The simplest solution is to take the domain out of your AJAX call and use a relative url, for example "/dir/ajax-callback.php" instead of "http://www.mysite.com/dir/ajax-callback.php"
You can create .htaccess file in your root dir and put this text inside
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite.com [NC]
RewriteRule ^(.*)$ http://www.mysite.com/$1 [L,R=301]
This will make sure that every time user enters http://mysite.com, it gets redirected to http://www.mysite.com
The server has to support .htaccess and mod_rewrite

Categories