dsbowmvth16379079 2016-01-30 23:49
浏览 43
已采纳

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

I am moving over my web app to a new domain on the same host, I have edited the .htaccess file and now see a redirect loop. The new domain does not have HTTPS but the old domain had an SSL certificate. I want to use no SSL for the new domain. Here is what I have in the .htaccess file:

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条回答 默认 最新

  • dongxing2030 2016-01-31 00:15
    关注

    Should be able to comment out the https RewriteRule

    Try changing

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

    To

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

    Or keep a backup and delete those lines

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?