Hello guys,

I'm stuck on a problem. I feel more confident in the administration of nginx..

After enabling SSL support and add recomended RewriteRule to .htaccess, I have a redirection loop.

Here is my vhost config:

Code:
<VirtualHost 111.222.33.44:80 >
	ServerName www.my-shop.net
	ServerAlias www.my-shop.net my-shop.net 
	ServerAdmin webmaster@my-shop.net
	DocumentRoot /home/admin/domains/my-shop.net/public_html/application/public
	ScriptAlias /cgi-bin/ /home/admin/domains/my-shop.net/public_html/application/public/cgi-bin/
	UseCanonicalName OFF
	<IfModule !mod_ruid2.c>
		SuexecUserGroup admin admin
	</IfModule>
	CustomLog /var/log/httpd/domains/my-shop.net.bytes bytes
	CustomLog /var/log/httpd/domains/my-shop.net.log combined
	ErrorLog /var/log/httpd/domains/my-shop.net.error.log
	<Directory /home/admin/domains/my-shop.net/public_html/application/public>
		php_admin_flag safe_mode OFF
		php_admin_flag engine ON
		php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f admin@my-shop.net'
		php_admin_value mail.log /home/admin/.php/php-mail.log
		php_admin_value open_basedir /home/admin/:/tmp:/var/tmp:/usr/local/lib/php/
	</Directory>
</VirtualHost>

<VirtualHost 111.222.33.44:443 >
	SSLEngine on
	SSLCertificateFile /usr/local/directadmin/data/users/admin/domains/my-shop.net.cert.combined
	SSLCertificateKeyFile /usr/local/directadmin/data/users/admin/domains/my-shop.net.key
	SSLCACertificateFile /usr/local/directadmin/data/users/admin/domains/my-shop.net.cacert
	ServerName www.my-shop.net
	ServerAlias www.my-shop.net my-shop.net 
	ServerAdmin webmaster@my-shop.net
	DocumentRoot /home/admin/domains/my-shop.net/public_html/application/public
	ScriptAlias /cgi-bin/ /home/admin/domains/my-shop.net/public_html/cgi-bin/
	UseCanonicalName OFF
	<IfModule !mod_ruid2.c>
		SuexecUserGroup admin admin
	</IfModule>
	CustomLog /var/log/httpd/domains/my-shop.net.bytes bytes
	CustomLog /var/log/httpd/domains/my-shop.net.log combined
	ErrorLog /var/log/httpd/domains/my-shop.net.error.log
	<Directory /home/admin/domains/my-shop.net/public_html/application/public>
		php_admin_flag safe_mode OFF
		php_admin_flag engine ON
		php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f admin@my-shop.net'
		php_admin_value mail.log /home/admin/.php/php-mail.log
		php_admin_value open_basedir /home/admin/:/tmp:/var/tmp:/usr/local/lib/php/
	</Directory>
</VirtualHost>
.htaccess file:

Code:
#AddHandler x-httpd-php53 .php

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

# use if needed:
#RewriteBase /

RewriteRule ^$ / [QSA]

RewriteCond %{REQUEST_FILENAME} ([a-z_]+?)_picture/(.*?)\.(?:jpg|png)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ([a-z_]+?)_picture/(.*?)/(.*?)\.(jpg|png)$ thumbnailer/create/$1/$2/$3/$4 [QSA,L]

# some hosts need redirect:
# RewriteRule ([a-z_]+?)_picture/(.*?)/(.*?)\.(jpg|png)$ thumbnailer/create/$1/$2/$3/$4 [QSA,R,L]

# redirects request to nonexisting CSS and JS to  empty CSS/JS files [so you dont need to define module CSS/JS if you dont need it]
RewriteCond %{REQUEST_FILENAME} ^(.*?)\.css$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ stylesheets/core/no_css.css [QSA,L]

RewriteCond %{REQUEST_FILENAME} ^(.*?)\.js$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ javascript/core/no_js.js [QSA,L]

# displays 404.html if IMAGE is not found
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} images/.*?(png|jpg|gif)
# ^^ may catch valid requests that contain "images/" and have image extension!!!!
RewriteRule ^(.*)$ 404.html [QSA,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
# also OK RewriteRule ^(.*)$ index.php/%{REQUEST_FILENAME} [QSA,L]

# define error pages
ErrorDocument 404 error_page.php
ErrorDocument 406 error_page.php
ErrorDocument 500 error_page.php