non wodpress subdirectory refusing to serve https content - wordpress

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]

Related

Moving WordPress from Live to Localhost MAMP

I am trying to back up my Wordpress website and want to test my website locally, without a SSL certificate. I have installed MAMP but I am facing some problems to make it work.
When I start the apache server and go the localhost, my homepage does show up but the CSS doesn't load and I get a bunch of errors regarding a cache plugin.
But the biggest problem I am facing is that whenever I go to another page, my local website immediately tries to load a HTTPS page and goes to my live website (even when I specifically mention a HTTP link).
I have tried changing the .htacces file with the following code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
I have also changed the database homepage URL from https to http in wp_options but that only fixed the index page but not the other pages of my website.
My apologies if my question is still unclear, I'm kind of new to this so any help would be appreciated.

.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 to force Wordpress in subdirectory to use correct url after domain change

I have two Wordpress sites, one living in the root directory of my server, one living in a directory. Let's call them:
www.domain.com and www.domain.com/folder/
This worked fine until now, when I needed to change my domain and server. I moved my files from one server to the other, got everything running with the new domain on the new server, and then "parked" the old domain on the new server via cPanel, setting up the following .htaccess code in the root directory to handle traffic to the old domain:
RewriteCond %{HTTP_HOST} ^domain.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.domain.com [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301,NC]
This appears to work perfectly for the "main" wordpress install, BUT, while visiting URLs for the Wordpress site in the subdirectory produce the correct results, they display the OLD url:
So, for example, if I visit:
http://www.domain.com/folder/page/
I see the content for:
http://www.newdomain.com/folder/page/ (eg. all the links etc. are correct)
But the URL still displays as http://www.domain.com/folder/page/
Nothing I do with .htaccess, etc. seems to change this. How can I force http://www.domain.com/folder/page/ to fully redirect to http://www.newdomain.com/folder/page/ not just show the content for it?

Mixed content - SSL http/https issue

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.

Redirect/Security Issue With Website Link

I'm running into a rather annoying problem with my website.
I have a valid SSL certificate running on my domain but every time I try to manually access a certain page from my website it appears as non-ssl.
If I browse the pages starting from my homepage they all appear to be fine but if I go directly to a page the browser tells me that is not secured.
The odd thing is that this only happens when I type the link without "https/https" and www. Ex: "mywebsite.com/my-page".
If I'm entering "www" before the domain name or http/https it redirects to the secure version.
As a side note, I'm using WordPress as my CMS.
I would highly appreciate the help.
Thank you.
You can force https by adding the following to your htaccess file:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

Resources