.htaccess图像上有太多的重定向

时间:2018-04-06 14:24:31

标签: apache .htaccess url-redirection

我有一个htaccess文件,我用它来获取一些干净的网址并强制使用www。 我添加了代码以将所有http流量重定向到https页面似乎工作。但有些图像没有加载。我得到了太多的重定向"错误。

# Redirect to www
RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

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

# Redirect to apps
RewriteRule ^apps/([^/]*)$ apps.php?app=$1 [L]
RewriteRule ^apps/([^/]*)/([^/]*)$ apps.php?app=$1&id=$2 [L]

0 个答案:

没有答案