2012-09-16 4 views
0

내 codeigniter 사이트에서 SSL을 설정하려고하지만 몇 가지 문제가 있습니다.Codeigniter + SSL + .htaccess + 무한 리디렉션

Codeigniter는 https : //에 액세스하지 않습니다. 파이어 폭스는이 오류가 표시

The page isn't redirecting properly. Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

내 설정 파일이 BASE_URL로이있다을

$config['base_url'] = "http".((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "s" : "")."://".$_SERVER['HTTP_HOST'].str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']); 

다음과 같이 내 htaccess로 파일은 다음과 같습니다

RewriteEngine on 
RewriteCond $1 !^(index\.php|first_cut|media|robots\.txt|user_guide|xd_receiver\.htm|channel.php) 
RewriteRule ^(.*)$ /index.php/$1 [L] 

가 이상적으로 HTTPS를 좋아하는 것 : // 항상이 폴더에 적용됩니다 ...

  • /페이스 북 사이트

    어떤 아이디어가의 나머지 부분에 대한/경쟁

  • /크기/

... 그리고 옵션 HTTPS를?

+0

당신이 무엇을 재 지정을받을 수 있나요? 'curl -i $ url'을 실행하고 결과를 보여주십시오. – cweiske

답변

0

존재하지 않는 파일 만 index.php으로 리디렉션하려는 것 같습니다. 쉬운 방법이 그것을 위해있다 :

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} -f 
RewriteRule ^(.*)$ /index.php/$1 [L] 
+0

이것은 500 내부 오류로 돌아와서 SSL 문제를 해결할 수 있습니까? –

1

친절이 코드를 시도

Options +FollowSymlinks 
RewriteEngine on 

RewriteCond %{HTTPS} off 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.+)/$ http://www.projectname.com/$1 [R=301,L] 
RewriteCond %{THE_REQUEST} ^.*/index.php 
RewriteRule ^(.*)index.php$ http://www.projectname.com/$1 [R=301,L] 

#search folder and redirect to subdomain 
RewriteCond %{HTTPS} off 
RewriteCond %{REQUEST_URI} dimentions 
RewriteRule ^(.*)$ https://www.projectname.com/$1 [R,L]