使用https时,通过.htaccess重定向*以进行索引

时间:2014-10-03 14:21:09

标签: apache .htaccess

我有一个简单的.htaccess文件,它将所有非现有文件重定向到index.php 当我通过HTTP访问我的网站时,它工作正常。但是当我尝试使用HTTPS时 重定向无效。这是.htaccess内容:

RewriteEngine on
RewriteBase /

php_flag display_errors on
php_value error_reporting 7

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /var/www/index.php [NC,L,QSA]

P.S。我需要保留HTTP和HTTPS选项。

0 个答案:

没有答案