Codeigniter .htaccess Dosyası

17 Eylül 2019 - 852 Okunma

Codeigniter için; .htaccess dosyasıyla https ve www. yönlendirmelerini rahatlıkla yapabileceğiniz dosyayı aşağıda paylaşıyorum.

RewriteEngine On

### START WWW & HTTPS
# www. redirect
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# https redirect
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
### END WWW & HTTPS

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]