将CodeIgniter网站移动到新域但是同一主机

时间:2016-01-30 23:49:04

标签: php apache .htaccess codeigniter ssl

我正在将我的网络应用程序移动到同一主机上的新域,我编辑了.htaccess文件,现在看到一个重定向循环。新域没有HTTPS,但旧域具有SSL证书。我想不为新域使用SSL。这是我在.htaccess文件中的内容:

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.mywebsite.com/$1 [R=301,L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|public|images|robots\.txt|css)
RewriteRule ^(.*)$ index.php/$1 [L]

1 个答案:

答案 0 :(得分:0)

应该可以注释掉https RewriteRule

尝试更改

RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.mywebsite.com/$1 [R=301,L]

#RewriteCond %{SERVER_PORT} 80 
#RewriteRule ^(.*)$ https://www.mywebsite.com/$1 [R=301,L]

或保留备份并删除这些行