# HttpsEnforcerMiddleware not redirecting to full path

**URL:** https://discourse.cakephp.org/t/httpsenforcermiddleware-not-redirecting-to-full-path/9283
**Category:** Need Help
**Created:** [April 23, 2021, 1:09pm UTC](https://discourse.cakephp.org/t/httpsenforcermiddleware-not-redirecting-to-full-path/9283 "2021-04-23T13:09:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![steveI](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/stevei/32/2195_2.png) [@steveI](https://discourse.cakephp.org/u/steveI)
#### Post date: [April 23, 2021, 1:09pm UTC](https://discourse.cakephp.org/t/httpsenforcermiddleware-not-redirecting-to-full-path/9283/1 "2021-04-23T13:09:37Z")

</div>

The HttpsEnforcerMiddleware redirects [http://localhost/dev/e4kids/coupons](http://localhost/dev/e4kids/coupons) to [https://localhost/coupons](https://localhost/coupons). I am using cakePHP 4.2.5  
In Application.php I have -  
-\>add(new HttpsEnforcerMiddleware([  
‘redirect’=\>true,  
‘statusCode’=\>302,  
‘disableOnDebug’ =\> false,  
]));
