Codeigniter https htaccess

.htaccess file is a configuration file used to override the main server configuration. .htaccess file placed in a directory and the configuration is applied to that particular directory and all the subdirectories. The most usage of .htaccess file is Rewriting URLs, Blocking, SSL, Customized error responses, Directory listing, Cache-Control, etc.


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
#RewriteEngine on
#RewriteCond %{HTTP_HOST} ^ [NC]
#RewriteRule ^(.*)$$1 [L,R=301,NC]

RewriteEngine on
RedirectMatch ^/(.*?)/$ /$1
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule (.*){REQUEST_URI} [R=301,L]

# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (
<IfModule php5_module>
   php_flag asp_tags Off
   php_flag display_errors Off
   php_value max_execution_time 7200
   php_value max_input_time 6000
   php_value max_input_vars 7200
   php_value memory_limit 512M
   php_value post_max_size 512M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/tmp"
   php_value upload_max_filesize 512M
   php_flag zlib.output_compression Off
# END cPanel-generated php ini directives, do not edit

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php56” package as the default “PHP” programming language.
<IfModule mime_module>
  AddType application/x-httpd-ea-php56 .php .php5 .phtml
# php -- END cPanel-generated handler, do not edit

Leave a Reply

Your email address will not be published. Required fields are marked *