Attachments
Screen Shot 2019-05-19 at 2.30.46 PM.png (131.06 KiB) Viewed 1351 times
Screen Shot 2019-05-19 at 2.38.30 PM.png (612.11 KiB) Viewed 1351 times
and possibly inserting some Reroute-Command into the .htaccess
file, as long as the config.php defined HTTP(S):// routing is not
set right. Check in your both config.php files, if the Links are
written similar to the links shown below:
It needs to look like: (http:// www. yourshopsite)
Code: Select all
// HTTP
define('HTTP_SERVER', 'http://www.hitline.info/shop/');
// HTTPS
define('HTTPS_SERVER', 'http://www.hitline.info/shop/');
Code: Select all
// HTTP
define('HTTP_SERVER', 'http://hitline.info/shop/');
// HTTPS
define('HTTPS_SERVER', 'http://hitline.info/shop/');
Code: Select all
// HTTP
define('HTTP_SERVER', 'https://www.hitline.info/shop/');
// HTTPS
define('HTTPS_SERVER', 'https://www.hitline.info/shop/');
Code: Select all
// HTTP
define('HTTP_SERVER', 'https://hitline.info/shop/');
// HTTPS
define('HTTPS_SERVER', 'https://hitline.info/shop/');
to find something in this place. I therefore advise anyone,
looking for OC answers, to check Google first, by using a few
Keywords, and with the OpenCart Name after the Keyword
Quotation, like: "SSL+Problems"+Opencart
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
# force both https and www. in one go
RewriteEngine On
RewriteCond %{HTTPS} !on [OR]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.awakeraisingawareness.com
Here's the link to those instructions: https://youtu.be/jf-XZ9tGewo
Here's the link to the instructions regarding the config.php files. https://youtu.be/jf-XZ9tGewo
Thanks
Attachments
awake-config.jpg (106.9 KiB) Viewed 1319 times
admin-config.jpg (94.94 KiB) Viewed 1319 times
and others don't, it depends on how a Server is configured, I guess.
You might find another Routine, to test it out.
Ernie
https://github.com/IP-CAM/htaccess-rules
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Code: Select all
# force both https and www. in one go
RewriteEngine On
RewriteCond %{HTTPS} !on [OR]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.awakeraisingawareness.com
You do not need to do this in one go as it makes no sense, two separate statements also constitute an OR function.
Code: Select all
# redirect non-ssl requests to ssl
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !.*\.(ico|txt|cur|mp3|mpeg|webp|svg|ttf|eot|woff|woff2|gif|jpg|JPG|jpeg|JPEG|png)
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [R=301,L]
# redirect any request not having www to ssl with www
RewriteCond %{HTTP_HOST} ^awakeraisingawareness\.com [NC]
RewriteRule ^(.*)$ https://www.awakeraisingawareness\.com/$1 [L,R=301]
besides, the "www" redirects are generally unnecessary unless you are putting links out there (bots, etc.) which do not have "www" included and why would you?
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Regarding #'s 2,3 and 4, I replaced the "example" domain with my domain. #'s 1 and 5...I have no idea where to put my domain name. Regarding the rest of the coding that sits below #5...I have no clue what to do with that.
If you could tell me where to put my domain name on 1 and 5, and whether I was correct on #’s 2,3 and 4, that would be great. And if I am incorrect on those, could you give me a hint as to how I can correct them?
As far as the coding below #5 goes, if you can give me some constructive input, that would be fabulous. If not, I understand.
1.
IfModule mod_rewrite.c>
# Redirect all traffic to https://www
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [NE,L,R=301]
</IfModule>
2.
<IfModule mod_rewrite.c>
# Redirect all traffic to https://www
RewriteEngine on
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule (.*) https://www.awakeraisingawareness.com%{REQUEST_URI} [NE,L,R=301]
</IfModule>
3.
<IfModule mod_rewrite.c>
# Redirect all traffic to https:// non www
RewriteEngine on
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule (.*) https://www.awakeraisingawareness.com%{REQUEST_URI} [R=301,L]
</IfModule>
4.
<IfModule mod_rewrite.c>
# Redirect all traffic to https:// subdomain
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.awakeraisingawareness.com%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]
</IfModule>
5.
<IfModule mod_rewrite.c>
# Cloudflare
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
I put my text in bold, not to yell at you, but to distinguish mine from the Github text. I hope I was clear on all of the above. If not, let me know, and I'll try again.
Thanks@ [/b}
# redirect non-ssl requests to ssl
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !.*\.(ico|txt|cur|mp3|mpeg|webp|svg|ttf|eot|woff|woff2|gif|jpg|JPG|jpeg|JPEG|png)
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [R=301,L]
# redirect any request not having www to ssl with www
RewriteCond %{HTTP_HOST} ^awakeraisingawareness\.com [NC]
RewriteRule ^(.*)$ https://www.awakeraisingawareness\.com/$1 [L,R=301]
Thanks!
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Hey letxobnav , Thanks for the help. Much appreciate! I've been stumped, and it's been looking a little bleek today.
# redirect non-ssl requests to ssl
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !.*\.(ico|txt|cur|mp3|mpeg|webp|svg|ttf|eot|woff|woff2|gif|jpg|JPG|jpeg|JPEG|png)
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [R=301,L]
# redirect any request not having www to ssl with www
RewriteCond %{HTTP_HOST} ^awakeraisingawareness\.com [NC]
RewriteRule ^(.*)$ https://www.awakeraisingawareness\.com/$1 [L,R=301]
I inserted the code you wrote into my root .htacess file...saved it, and when I tested it, the front side worked perfectly, but the admin didn't accept my user/password. So, I deleted the code, and now it both sides work again. Have any thoughts about why your code didn't work? Could it be that the server name is not set correctly with www included like you said?
just after:
Code: Select all
public function index() {
Code: Select all
$this->log->write('My Server variables '.print_r($_SERVER,true));
and that will list your server variables in your oc log file.
you only have to do that once and then make a note of it or comment it out again.
this should have a line:
Code: Select all
[SERVER_NAME] => YOUR SERVER NAME
do that first so you know what we deal with.
you might also post what you have in config.php and admin/config.php wrt HTTP_SERVER and HTTPS_SERVER.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Code: Select all
$this->log->write('My Server variables '.print_r($_SERVER,true));
Code: Select all
$this->log->write('My Server variables '.print_r($this->request->server, true));
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Users browsing this forum: Bing [Bot] and 386 guests