ddev / TYPO3 / .htaccess - redirect all http -> https

一曲冷凌霜 提交于 2021-02-18 19:43:34

问题


I need help pls understanding ddev/apache and redirects

T3 site config.yaml

base: 'https://sample-project.ddev.site/'

ddev config.yaml

name: sample-project
webserver_type: apache-fpm
router_http_port: "80"
router_https_port: "443"
use_dns_when_possible: true

that works fine when calling in safari https://sample-project.ddev.site/ but when calling in safari sample-project.ddev.site it does not work I get an T3 oops so I have inserted in .htaccess (equivalent to my hosting server)

RewriteCond %{HTTPS} !off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}/$1 [L,R=301]

now safari moans too many redirects and I wonder where these redirects come from and why, no redirects in T3 backend are set, no further changes to .htaccess vs the original T3 .htaccess I was expecting ddev to simply redirect sample-project.ddev.site to https://sample-project.ddev.site/


回答1:


Please use such redirect

  RewriteCond %{HTTP:X-Forwarded-Proto} !https
  RewriteCond %{HTTPS} off
  RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]


来源:https://stackoverflow.com/questions/65761649/ddev-typo3-htaccess-redirect-all-http-https

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!