htaccess https重定向到子目录而不是root

时间:2018-10-08 17:30:09

标签: apache .htaccess redirect https

当前的.htaccess代码

RewriteCond %{HTTPS} off
RewriteCond %{HTTPS_HOST} !^test.com$ [NC]
RewriteRule ^(.*)$ https://test.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^www.test.com$ [OR]
RewriteCond %{HTTP_HOST} ^test.com$
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ subdirectory/index.php [L]
RewriteRule ^([a-z0-9-_]+)\ ([^/]+)/(.*)/? /$1$2/$3/ [L]

期望的行为:将非http流量重定向到https,并且请求也应由位于子目录中的laravel的index.php处理。 https://test.com

实际行为:它将流量重定向到http s ://test.com/ 子目录,而不是https://test.com

0 个答案:

没有答案
相关问题