# Questions about the redirect from http to https

**URL:** <https://community.traefik.io/t/questions-about-the-redirect-from-http-to-https/15448>\
**Category:** Traefik v2\
**Tags:** kubernetes-ingress, middleware\
**Created:** [August 15, 2022, 5:14pm UTC](https://community.traefik.io/t/questions-about-the-redirect-from-http-to-https/15448 "2022-08-15T17:14:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryo](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ryo/32/5743_2.png) [@Ryo](https://community.traefik.io/u/Ryo)\
**Post date:** [August 15, 2022, 5:14pm UTC](https://community.traefik.io/t/questions-about-the-redirect-from-http-to-https/15448/1 "2022-08-15T17:14:40Z")

</div>

as an example:

running an https service on port 8443  
need to redirect http traffic to https protocol like  
http://my\_domain:8443/ --\> https://my\_domain:8443/  
the following configurations does not work

```auto
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: http2https
spec:
  redirectRegex:
    regex: ^http://(.*)
    replacement: https://${1}
    permanent: true
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: http2https
spec:
  routes:
    - match: HostRegexp(`{host:.+}`)
      kind: Rule
      middlewares:
        - name: http2https
      services:
        - name: noop@internal
          kind: TraefikService

```

later I found out that it works properly after removing the following parameters (including other related parameters)

```auto
--entrypoints.websecure.http.tls

```

and explicitly add the following configuration to **EVERY** ingressroute except the "http2https"

```auto
  tls:
    certResolver: [my_resolver_name]
    domains:
    - main: "my_domain"

```

this works but I wish it could be more concise

for example, implement the following configuration to enable it to capture http traffic

```auto
  tls:
    - enable: false

```

(or is it just because I misconfigured something?)  
(or other existing implementations?)

thx
