Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache htaccess-将所有流量重定向到app.example.com_Apache_.htaccess - Fatal编程技术网

Apache htaccess-将所有流量重定向到app.example.com

Apache htaccess-将所有流量重定向到app.example.com,apache,.htaccess,Apache,.htaccess,我试图重定向我的应用程序,但我有一些问题。 我试过: Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} ^app.example.com [NC] RewriteRule ^(.*)$ https://app.example.com/$1 [R=301,L] RewriteRule .* index.html [L] 我想重定向来自以下位置的所有传入流量: app.example.com www.app.

我试图重定向我的应用程序,但我有一些问题。 我试过:

 Options +FollowSymLinks
RewriteEngine On  
RewriteCond %{HTTP_HOST} ^app.example.com [NC]
RewriteRule ^(.*)$ https://app.example.com/$1 [R=301,L]

RewriteRule .* index.html [L]
我想重定向来自以下位置的所有传入流量:

app.example.com
www.app.example.com
http://app.example.com
https://www.app.example.com
to https://app.example.com
有什么帮助吗

RewriteEngine On
RewriteCond %{HTTP_HOST} !^app\.example\.com$ [NC]
RewriteRule (.*) http://app.example.com$1 [R=301,L]
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

//this redirect all not existing routes to index.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]