Blog

Python 3.7 And 2.7 Installation Steps On Windows 10

Changing python default versions on fedora 27?

Python websockets installation is failed on fedora linux

Network Basics

Document Clustering

Clustering Techniques

SQL Injection and Prevention Techniques

Google Form Intro and App Scripts

Download in Youtube using Youtube-dl commands

Java Network Launch Protocol File Launch Issue

javaws command is not working

Forcing Website with HTTPS instead of HTTP

Cricket Scores API's

Design Patterns

IIS Installation and Configuration on Windows 10

Unable to start debugging on the web server (IIS Error Code 405)

Google Chrome Installation on Fedora 26, CentOS / RHEL 7.4

Install Fedora 26 On Virtual Machine Using VirtualBox in Windows 10

Using screen command in fedora 25

Java JDK 1.8 Installation Steps On Windows 10

Enable Permanent SSH Access on Linux

C Program Undefined Reference Error

Curl error and couldn't resolve hostname fedora mirrors

Installing Android Studio in Windows 10

Resetting Root password on Fedora 26

Installing visual studio code editor steps for fedora 27 / centos 7 / RHEL 7

Java JNI Error UnsupportedClassVersionError in Windows 10

Install virt-customize in RHEL 8

Updating qcow2 image in RHEL 8

Remove the files from dir in another dir

Install virtualenv in RHEL 7

Install Scapy in RHEL 7

SQL ACID properties

Forcing Website with HTTPS instead of HTTP



Difference between HTTPS and HTTP?

HTTPS means Hypertext Transfer Protocol Secure. HTTPS protocol uses an encrypted HTTP connection by transport-layer security.
Customer may share private information in the website, HTTPS is used to transfer private information in secure to the server.
SSL (Secure Socket Layer) is added in HTTPS than HTTP to establish SSL connection between client and server.
  • Client and server is establish by handshake and ensures that client is communicating to right server.
  • 2) Client and server encryptes and exchange data between them.

How to make PHP website as HTTPS?

You have a website which is created in PHP, then you want to access all pages through HTTPS instead of HTTP.
Some times home page may be loaded as insecure with HTTP protocol.

How to enforce loading all the pages in website as HTTPS instead of HTTP?

Please copy this below code in .htaccess file in website folder.
# Apache Rewrite Rules
 <IfModule mod_rewrite.c>
  Options +FollowSymLinks
  RewriteEngine On
  RewriteBase /

  RewriteCond %{HTTPS} !=off
  RewriteRule ^/?(checkout|account|admin) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
  RewriteCond %{SERVER_PORT} 80 
  RewriteCond %{HTTP_HOST} ^test_website\.com [NC] 
  RewriteRule ^(.*)$ https://www.test_website.com/$1 [R,L]

  RewriteCond %{HTTPS} off
  RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# End of Apache Rewrite Rules
 </IfModule>
Copy this code in config.php file in website folder.
config.php
// HTTP
define('HTTP_SERVER', 'https://www.test_website.com/');
// HTTPS
define('HTTPS_SERVER', 'https://www.test_website.com/');
define('HTTPS_IMAGE', 'https://www.test_website.com/image/');
This changes will improve your website with HTTPS protocol.

How to prevent accessing javascript and css files directly in website?

We can add .htaccess in folder where javascript files are exists. Create .htaccess file in Javascript files folder
<Files ~ "\.js$">
    order allow,deny
    deny from all
</Files>
We can also add .htaccess file CSS files folder to protect CSS files from direct access.
<Files ~ "\.css$">
    order allow,deny
    deny from all
</Files>
Add one more Files block if css or javascript file contains multiple dots(.) like style.min.css
<Files ~ "\min.css$">
    order allow,deny
    deny from all
</Files>


 Blog

Python 3.7 And 2.7 Installation Steps On Windows 10

Changing python default versions on fedora 27?

Python websockets installation is failed on fedora linux

Network Basics

Document Clustering

Clustering Techniques

SQL Injection and Prevention Techniques

Google Form Intro and App Scripts

Download in Youtube using Youtube-dl commands

Java Network Launch Protocol File Launch Issue

javaws command is not working

Forcing Website with HTTPS instead of HTTP

Cricket Scores API's

Design Patterns

IIS Installation and Configuration on Windows 10

Unable to start debugging on the web server (IIS Error Code 405)

Google Chrome Installation on Fedora 26, CentOS / RHEL 7.4

Install Fedora 26 On Virtual Machine Using VirtualBox in Windows 10

Using screen command in fedora 25

Java JDK 1.8 Installation Steps On Windows 10

Enable Permanent SSH Access on Linux

C Program Undefined Reference Error

Curl error and couldn't resolve hostname fedora mirrors

Installing Android Studio in Windows 10

Resetting Root password on Fedora 26

Installing visual studio code editor steps for fedora 27 / centos 7 / RHEL 7

Java JNI Error UnsupportedClassVersionError in Windows 10

Install virt-customize in RHEL 8

Updating qcow2 image in RHEL 8

Remove the files from dir in another dir

Install virtualenv in RHEL 7

Install Scapy in RHEL 7

SQL ACID properties

Privacy Policy  |  Copyright@2017 - All Rights Reserved.  |  Contact us   |  Report website issues in Github   |  Facebook page   |  Google+ page

Email Facebook Google LinkedIn Twitter
^