http to https www redirect

1. Redirect All Web Traffic


RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 

2. Redirect Only a Specific Domain


RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 

3. Redirect Only a Specific Folder

Redirecting to HTTPS in a particular folder, add the following:

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteCond %{REQUEST_URI} folder 

Note: Replace “yourdomain” with your actual domain name wherever required. Also, in case of the folder, replace /folder with the real folder name.

which language is best for socket programming

It really depends on what you mean by network programming. So I’ll run through a couple possibilities. Commentators: Don’t fret if I forgot “your language.” The question is so open-ended. It’s like asking ‘What kinds of vehicles are good for getting me from New York City to Boston?’

  • You want to write a program that participates in XML-RPC or similar.
    • C# or Java
  • You are network programming in the context of a web page
    • JavaScript
  • You need some machines to talk to each other in some other existing protocol, and you need it done quickly.
    • Python or Perl
  • You need to write a distributed program that needs to be up and running all the time, not even resting for upgrades
    • Erlang
  • You need to write a distributed program that is very fast and does a bunch of things at once
  • You need to write a new network driver, for a new network protocol you thought up yourself
    • C, C++
  • You just want to network some TCP sockets together

5 Best Programming Languages to Learn for Cyber Security

1. C and C++



The C programming language is the backbone of most operating systems. It is a lean, flexible, and efficient language that can be used to complete a wide range of tasks such as cryptography, image processing, and socket networking.

Essentially, C++ is usually regarded as C’s big brother — which has been concocted with crack, meth, and steroids and mixed without any favors. C++ is a fantastic language that is largely based on C’s source code.

There are several cyber security programs created using C++. For example, Nmap, the network mapper tool, is created using C++.

Here is a marvelous quote from Bjarne Stroustrup, the creator of C++:


As a cyber security expert, if you are experienced at using C/C++ programming languages, you’ll know how to respond to attacks targeting lower level operations within your computing environment.

2. Python

Python is a high-level programming language that is increasingly becoming popular among cyber experts.

It’s gaining traction mainly because of its adherence to code readability, clear and simple syntax, and availability of an extensive number of libraries.

So, whatever task you want to do, you can always complete it easily with Python.

For example, you can use the language to send TCP-packets to machines, perform malware analysis, and create intrusion detection systems with minimal reliance on third-party tools.

However, unlike C/C++, Python is not low-level; therefore, it may not provide enough visibility to hardware resources.

Learning Python for cyber security will give you an edge in your career. You’ll be equipped with programming skills that can assist you to identify vulnerabilities and discover how to fix them.

No programming knowledge required

3. JavaScript

JavaScript is a high-level programming language, which is often referred as the “lingua franca” of the web.

JavaScript is a core technology that powers the Internet. Primarily, it’s the language that adds interactivity to web pages.

Although JavaScript was initially implemented only on the client-side in web browsers, it’s now possible to use the language in other types of host infrastructure, such as server-side in databases and offline applications like PDF programs.

Therefore, because of its extensive usage, learning JavaScript can make you go one step ahead of the hackers.

You’ll understand the concepts of how websites and other applications work and the best designs to employ to ward off malicious users.

For example, cross-site scripting is a JavaScript-based attack that involves an attacker implanting malicious code in a web application.

If you are experienced in using the JavaScript programming language, you can prevent such types of attacks from occurring.

4. PHP

PHP is a server-side programming language for developing websites. Because most websites are created using PHP, learning the language will enable you to know how to fend off intruders.

For example, DDoS (Denial-of-service) attacks usually attempt to make web applications unavailable to intended users.

With PHP programming knowledge, coupled with skills in other technologies like JavaScript, you can implement robust solutions to secure web applications.

5. SQL

SQL (Structured Query Language) is mostly used in managing data stored in databases.

Because of the current explosion of data storage systems, SQL is widely used for maintaining and retrieving data.

Similarly, hackers are increasingly orchestrating the language for damaging or exfiltrating the stored data.

For example, SQL injection attacks involve exploiting SQL vulnerabilities to steal or modify data kept in databases.

Therefore, having a good understanding of the SQL language is critical in your cyber security career.

how whatsapp qr code works

Step 1) Browser sends hello message to Node.js server using Websocket.

Step 2) Node.js server generates a unique identifier and sends to browser using Websocket. Then browser generates a QR code using unique identifier and shows to user.

Step 3) User login to the mobile app using Facebook authentication.

Step 4) After the successful authentication, user scans the QR code.

Step 5)  After scanning, App sends Unique ID (from QR), access token (from FB) to Node.js server.

Step 6) Node.js Server sends access token to the respective browser using Websockets.

Step 7) Browser get the Facebook user information using recevied FB access token.

__autoload() is deprecated, use spl_autoload_register() instead


function __autoload($class) {
    if (file_exists(APPPATH."core/".$class.'.php')) {


spl_autoload_register(function($class) {

The difference between DV and OV certificates

We know that the SSL-certificates can be divided into three types: DV, OV and EV. In this article, we will focus on the first two types of certificates, DV and OV. We will explain how they differ and when you should choose DV over OV.

DV-certificates (Domain Validation). This is the most basic level of SSL validation. The Certification Authority (CA) only ensure that you are the owner of a specific domain using the information contained in the WHOIS. Naturally, this type of certificate enables secure data encryption on your site, but it does not verify that you are the owner of a legitimate business. It is legitimate, and, most importantly, it is a very quick solution to protect your site using HTTPS. Customers seeing the padlock in your browser will have more trust in your site than before, because the padlock is a recognised sign of legitimacy.

Example of a DV certificate:

A DV certificate is fine where security is not a concern: however, attackers can also use DV-certificates on phishing sites. Unsuspecting users see the trusted pad lock and enter their personal data on the site which can then fall into the hands of fraudsters. The fact that the data channel is secured does not necessarily mean that the data will go to the right people. A user needs to be sure that the site belongs to a legitimate company if they are to make a purchase or input important information. 

For this reason, if security is a necessity for your site, we recommend an OV-certificate.

OV-certificates (Organisation Validation) are required for companies and organisations where users must enter sensitive information (credit card numbers, contact information, etc.).In particular, they are useful for e-commerce sites or online sales. An OV-certificate authenticates the owner of the site and requires legitimate business information for that company. The validation process for these certificates is longer and more detailed. The Certification Authority not only verifies the fact that you own the domain, but also the fact that you are the owner of the company. The company must be in a business registry database and in a trusted online directory (for example, Fraudsters cannot get an OV certificate because their organisation cannot be validated. The main advantage of getting an OV-certificate is that your company will be listed on the certificate.

Example of an OV-certificate:

  • You need to protect sensitive user data
  • You want to display your company name on a certificate (provides more trust amongst users)
  • You are planning to expand the business and grow it to a new level
  • You want people to know that the site is a legitimate organisation, and not a phishing site

You should think about switching from a DV-certificate to an OV-certificate, if:

If you want to switch from a DV-certificate to an OV-certificate, be sure to contact our experts at LeaderTelecom. Our knowledge, experience and streamlined process for dealing with the CAs will make issuing an OV-certificate easy and convenient.


What to change in the examples below?


Redirecting a URL

Redirect to a local site file

Redirect to an external site file

Redirect /path/to/old/file/old.html
The first path

The second path

Examples of redirects
Redirect from an index.html file to a different directory
Redirect /index.html /new/
Redirect from index.html to default.html
Redirect /index.html /default.html
Redirect a local /private directory to another site's private directory
Redirect /private/

Redirect /img/logo.gif
Using Regular Expressions

Redirecting error messages

ErrorDocument 404
Redirecting an old directory to new directory

Redirect non-existing pages to index.php

Options +SymLinksIfOwnerMatch 
RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Automatically loading a subdirectory

RewriteEngine on
RewriteRule ^$ /subdir1/ [L]
Forcing www in the URL
RewriteEngine On
RewriteCond %{HTTP_HOST} ^
Removing www in the URL
RewriteEngine On
RewriteCond %{HTTP_HOST} ^
Rewriting a URL
This example rewrites a URL to another URL. This rewrites to

Options +FollowSymLinks
RewriteEngine On
The following explains the rules above:



mod-rewrite cheat sheet
Rewriting non-existing links to index.php

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

how to run node js using domain

You dont assign a domain to a node.js server, instead you load your app onto a machine which has an ip adress, which in your case is You then need to make sure your app is listening on the correct port, which on most servers is 80

using express it’s as simple as

var app = express()
  , io = io.listen(server);


now getting a domain name to point to this ip adress is an entirely separate matter. You need to make your name server point to the ip. Your name server will usually be the company you bought the domain name through, for instance GoDaddy is a Domain Name Server (DNS). So if you had a domain name with them, you would go on their site under DNS settings and change the ip adress. Your domain name will then point to your ip adress and should render your node.js app.

How to Install the Ionic

Install Ionic

npm install -g ionic

First, install Node.js. Then, install the latest Ionic command-line tools in your terminal. Follow the Android and iOS platform guides to install required tools for development.

Start an app

ionic start myApp tabs

Create an Ionic App using one of our ready-made app templates, or a blank one to start fresh. Check out the Market for more designs.

For v1 projects, use the --type ionic1 flag.
  1. $ ionic start myApp blank
  2. $ ionic start myApp tabs
  3. $ ionic start myApp sidemenu

Run your app

cd myApp ionic serve

Much of your app can be built right in the browser with ionic serve. We recommend starting with this workflow.

When you're ready to deploy your app to a real device, check out our Deploying guide.

what is amazon elastic compute cloud

What Is Amazon EC2?


Features of Amazon EC2

Amazon EC2 provides the following features:

  • Virtual computing environments, known as instances