17 votes

Magento's Secure/Unsecure Image Link - Link Securely for Secure Pages only

Use _secure attribute. Ex: <img src="{{media url="wysiwyg/infortis/ultimo/menu/featured2.jpg" _secure="true" }}" />
Rafael Ortega Bueno's user avatar
12 votes

Magento 2: How to get current IP Address?

Try This\ use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; use Magento\Framework\HTTP\PhpEnvironment\RemoteAddress; class Index extends Action { private $...
Waqar Ali's user avatar
  • 2,319
7 votes
Accepted

Magento and HTTP/2 : what is the current status?

There is no problem with HTTP/2 "just working". But there is opportunity for further optimization. My understanding is it is worth looking into capabilities of your CDN provider if you want to take ...
Alan Kent's user avatar
  • 3,488
6 votes

ERR_TOO_MANY_REDIRECTS error when setting up HTTPS

Just to close this out, a good friend of mine suggested I try this, and I am very pleased to say it worked. Perhaps it will help someone else who faces the same issue: In .htaccess file, add these ...
Nick Hoare's user avatar
6 votes

Magento 2 with Varnish sometimes does not redirect HTTP to HTTPS

The issue was the Pound was only listening to 443 (https) and all HTTP was going straight to Varnish. Magento was supposed to be redirecting but sometimes Varnish would just send the HTTP version. ...
YWSW's user avatar
  • 336
6 votes
Accepted

How to force https on magento 2?

to force HTTPS, change your base url to https:// for unsecure too: bin/magento setup:store-config:set --base-url="https://myshop.com/" --base-url-secure="https://myshop.com/" --use-...
MagenX's user avatar
  • 3,820
5 votes

Magento 2 - what full page caching software should I use if I plan to use HTTPS?

I assume you're not referring to Magento 2. For Magento 1.x, you can use Turpentine to let Magento work with Varnish. Fair warning, this is by no means a "plug and play" process! Varnish does not ...
Aric Watson's user avatar
5 votes

Force HTTPS on all pages in the frontend, not just Checkout/Account

For anyone stumbling across this (like I did) Don't use htaccess. Under admin go Stores -> General -> Web and change -> Use Secure URLs on Storefront -> Yes and Use Secure URLs in Admin -&...
Andrew's user avatar
  • 59
5 votes
Accepted

Setting my base_url to Secure

You need to edit your htaccess file for this kind of redirect. See below: ## enable rewrites Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} ^example.com$ [NC] ...
Chirag Rajput's user avatar
4 votes

HTTPS everywhere - Magento 2

Your VirtualHost configuration is basically correct. As you alluded to yourself, you will need to set the unsecurebaseurl (and securebaseurl) to be https. Magento uses the unsecure urls for basically ...
Peter O'Callaghan's user avatar
4 votes

Magento2 with Varnish 4 and Nginx as SSL termination ends in mixed content

If you're having issues with Magento not detecting the HTTPS redirect, you can add this to your the Magento .htaccess file located in your docroot: ############################################ ## ...
jaywilliams's user avatar
4 votes

Magento2 with Varnish 4 and Nginx as SSL termination ends in mixed content

Final I found the solution. Replace the Base URL from http://example.com/ to //example.com/ CAUTION! The change is not allowed in magento2 admin. I made it in MySQL in table cron_config_data and ...
George A.B.'s user avatar
4 votes

Magento and HTTP/2 : what is the current status?

You definitely can use Http/2 with any version of Magento. And yes, you need to enable https for all pages (it's recommended setup for M2, why do you not did it before). Also, bundling of js files don'...
KAndy's user avatar
  • 20.8k
4 votes
Accepted

Magento 2 secure URL

I'm pretty _secure only works if the URL natively supports HTTPS. In case it does not (which seems to be your case as your code is totally valid) you can force it using _forced_secure: $this->...
Raphael at Digital Pianism's user avatar
4 votes

form post - getURL secure (HTTPS / SSL)

You can do so by using the _secure parameter: <?php echo Mage::getUrl('productquestions/productquestions/saveanswers',array('product_questions_id'=>$id, '_secure' => true));?>
Raphael at Digital Pianism's user avatar
4 votes

Remove HTTPS auto redirect

Open your core_config_data table in phpMyAdmin. Find the row with the path web/secure/use_in_adminhtml and change its value field from 1 to 0 to enable accessing admin panel from unsecure http://www....
Vaishal Patel's user avatar
4 votes

ERR_TOO_MANY_REDIRECTS error when setting up HTTPS

Check if your https is properly configured, eg. here https://www.sslshopper.com/ssl-checker.html Clean Magento cache. Clean your browser cache and Magento domain cookies. Try it on "private" browsing ...
A.Maksymiuk's user avatar
4 votes

Magento 2.2.5: Admin login page redirect loop 301/302 after installing SSL and enabling HTTPS

Try the following query: SELECT * FROM `core_config_data` WHERE path = 'web/secure/use_in_adminhtml' ; if path web/secure/use_in_adminhtml has value of null Update the value to 1 using the ...
AbdulKarim's user avatar
3 votes

Magento and HTTP/2 : what is the current status?

If you want to set all pages to HTTPS, you might also want to enable HSTS (More info: https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security). For the rest of it, I never had any trouble using ...
Arjen Miedema's user avatar
3 votes

Magento wrongly redirects https!

Had exactly the same issue, but on Nginx. Resolved by adding the following into the nginx domain .conf file. fastcgi_param HTTPS on;
elfling's user avatar
  • 768
3 votes
Accepted

HTTPS for all pages - how to do 301 redirect instead of 302?

If you've disabled the "Auto-redirect to Base URL" setting, then Magento isn't responsible for the 302 redirect to https. This must be caused elsewhere, most likely in your .htaccess or VirtualHost on ...
Peter O'Callaghan's user avatar
3 votes
Accepted

Update Google Results to https

I found the answer: https://magento.stackexchange.com/a/107086/26062 I added the following to .htaccess RewriteCond %{HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
Joe Palaca's user avatar
3 votes

Apache proxy + Varnish + Magento (HTTPS not caching)

Problem solved. The problem wasn't my .vcl file or apache config. The problem was inside the module I use with my Magento sotre (CE 1.5.1). The module is Phoenix-media pagecache for MAgento (https://...
Timothy GERETS's user avatar
3 votes

Set up https magento

Force HTTPS throughout the store may fix your issue. You can do that by specifying HTTPS URL in unsecure base URL as well. It may be caused by loading the css with unsecure base URL somewhere in your ...
vignesh's user avatar
  • 156
3 votes
Accepted

Magento2.2.5 - getting error

I guess you are using Magento\Framework\App\Action\HttpPostActionInterface in your controller? As I see, Magento 2.3.x has this interface class, but it doesn't exist in lowser version 2.2.x.
Khoa TruongDinh's user avatar
3 votes
Accepted

Magento 2: How to get current IP Address?

Please try following if(!empty($_SERVER['HTTP_CLIENT_IP'])){ //ip from share internet $ip = $_SERVER['HTTP_CLIENT_IP']; }elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){ //ip pass from ...
Chirag Gondaliya's user avatar
3 votes
Accepted

Some pages on Magento 2 website displaying Error 502 when Varnish cache is enabled - website hosted on Ubuntu 18.04 Nginx VPS

proxy_buffer_size 256k; That size is huge and won't do you good. You can read the guide on how to tune it properly with one important note: fastcg_buffer_size and proxy_buffer_size are ...
Danila Vershinin's user avatar
3 votes

Magento2.3.2: url shows http instead of https

First Check status: select * from `core_config_data` WHERE `core_config_data`.`path` = "web/secure/use_in_frontend"; select * from `core_config_data` WHERE `core_config_data`.`path` = "...
matinict's user avatar
  • 1,559
2 votes

Force HTTPS on all pages in the frontend, not just Checkout/Account

I have tried the previous solutions and even though they seemed to work they locked me out of admin panel (don't completely understand the reason). To get into the admin panel again I had to get into ...
GiorgosK's user avatar
  • 231
2 votes

Set skin url as unsecure in email template at the backend

Background This is one of those instances where PHP loose-typing was not handled carefully. If you look at the implementation of Mage_Core_Model_Design_Package::getSkinUrl, which is what the {{skin ...
fantasticrice's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible