Add to collection
Expert User

Expert User

Verified

Redirect HTTP to HTTPS

Redirect HTTP to HTTPS

Place the below code in .htaccess file of your application and also put your domain name in "Your Domain Name."

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/$1 [L]

RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
  RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
  # RewriteEngine On 
  RewriteCond %{SERVER_PORT} 80 
  RewriteRule ^(.*)$ https://Your Domain Name/$1 [R=301,L]

</IfModule>
NA
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/$1 [L]

RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
  RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
  # RewriteEngine On 
  RewriteCond %{SERVER_PORT} 80 
  RewriteRule ^(.*)$ https://Your Domain Name/$1 [R=301,L]

</IfModule>
NA
NA
NA
Tagged with: Redirect HTTP to HTTPS

Comments 0

  • Sorry!! No comment posted yet. Become the first user to give comment.
Add a comment

Would you like to write for w3 sniff?

Become part of an amazing group of contributors and authors and start writing for us

Join Now
NA
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/$1 [L]

RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
  RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
  # RewriteEngine On 
  RewriteCond %{SERVER_PORT} 80 
  RewriteRule ^(.*)$ https://Your Domain Name/$1 [R=301,L]

</IfModule>
NA
NA
NA
Feedback submitted successfully.