Archive

warning: cannot modify header information

When you visit your website sometime you see an error: Warning: cannot modify header information  – headers already sent by (output started at /public_html…….)

This error may occur from developer side. Sometimes send the output before calling header or most occur due to whitespaces.

warning: cannot modify header information

How to resolve this error:

you can resolve this problem by coding. Because this error may occur when you send your code output before the header () function. To avoid this problem you should set your header function before send the code output. To resolve this problem you will hire a developer.

Another method is to resolve this error by creating a phprc file. If you don’t know how to coding then don’t worry about that. you can solve this error within few lines. First of all you should know that how to create phprs file. you can create phprc file by using FTP or SSH.

How to create a phprc file in FTP:

  1. you login to your web server via FTP client. you are using file zilla for this process.

step 1 login file zilla

  1. Ensure that you are in your correct directory. Otherwise your small problem going to be big problem.
  2. Click on .php file which you see that already exit.

step 4 php file

  1. In .php folder you can see that there are several other folders. Which are representing the version of php. For choosing the version from this folder. you should ensure that which version is your site is using. For example your site using 7.4 and you should click on 7.4.

step 4 php versions

  1. In this directory you will see a phprc file. Right click on phprc file and choose view or edit.

step 5 edit file

  1. After clicking on this file you can see the following lines of code which is open in your default editor.

step 6 code

  1. When you complete your task then you want to save your file then you see a pop up message. Which show that file is change and check box ‘finish edit and delete local files’. Now click on yes button.

step 7 save file

 

  1. When you complete these steps then check that any php process is in running form or not. if process is running then kill off all these process. Which are running in php.
  2. When you have to complete all steps and kill the php process. Now confirm that your files our update or not. you can check by using phpinfo.php file.

Note: when different php versions are running in your site. E.g. you have four domains first two domains are using 7.3 version of php. Domain using 7.2 and fur using 7.4. And the problem is with 7.2 then you create a phprc file for 7.2.

you can create phprc file using SSH.

You might be interested in following articles:

How To Update Php In WordPress

Php Max_execution_time

How to create phprc file using SSH:

  1. Login to your website server via SSH.
  2. First ensure that you are in correct directory or not. For this type

[server]$ pwd

/home/example_username

  1. Run the mkdir If you want to create phprc file in 7.2 version then choose 7.2.

[server]$ mkdir  -p ~/ .php/7.2

  1. Change your directory into these folders which you create. By using the cd command.

     [server]$ cd .php/7.2

When you run pwd command. you can see the path of file which you create.

[server]$ pwd

/home/example_username/.php/7.2

  1. In the current folder create the phprc file without extension.
  2. Run this command for create the phprc file.

  [server]$ nano phprc

By using this command your nano text editor will open.

  1. Now you are going to edit your file using your php customization.

;{{{ this following lines were automatic added by arzhost_extension=opcache.so; }}}

  1. Now close your file and return to your shell.
  2. After completing all these steps. you should kill your running php processes. And ensure that your setting is update or not.
  3. you can see that your error Warning: cannot modify header information  – headers already sent by (output started at /public_html…….)  will remove.

how to zip a directory in unix

Zip is like a container in which you compress the files and contain huge data. When you want to transfer a huge data to another place. Then you compress the files and transfer data. you save the zip files using .zip extension. Today websites have heavy data when you want to download some files then you download in compressed form. you save these files using .zip extension and compress files using software which is installed in your system. Today almost every operating system has zip system like UNIX, mac and windows etc. here you use unix you should know that how to zip a directory in unix.

How top zip folder using zip command in UNIX:

You can zip the files in UNIX by using the zip command. There are many option to zip files, when you use zip command as well as you use many other option like ‘-r’ ‘f’ ‘u’ ‘d’ ‘m’ ‘j’ ‘o’ ‘9’ ‘q’ ‘v’ ‘c’ and there are many others every option have its own characteristics. But here you use ‘-r’ option. If you want to zip folder you write these lines of code:

$ zip –r <output_file>  <folder_1>  <folder_2>  … <folder_n>

If you want to archive a folder name ‘arzhost’ in zip file which is ‘test.zip’. for achieve this task you use these commands:

                            $ zip –r test.zip arzhost

If you want to see that our zip file is created or not then you use ‘Is’ command for archive file.

                                    $ Is – I  |  grep .zip 

If you didn’t know that where your zip file is store then you use these lines of code to find oyour files.

 $ find  /  -name  * .zip  2>  /dev/null 

Zip the folder using FIND option:

One of the most power full command is to zip files into your folders. you use ‘FIND’ command and link it to ‘exec’ option for execute the zip command. If you want to zip your folders in current working directory then you use these lines of code.

                 $ find . -maxdepth 1 -type d -exec zip archive.zip {} +\     

zip folder using find

 How to zip directories using bash system:   

you can zip folders using bash programming language. Sometime you haven’t any GUI then you can zip files in CLI using bash programming. If you want to zip any folder in bash language then you use ‘for loop’. you follow these lines of code:

                   $ for file in $(ls -d */); do zip archive.zip $file; done  

zip directories using bash

If you want to zip a folder which is start with any letter e.g. E .A folder is start with E letter then you follow these lines of code:

                  $ for file in $(ls -d */ | grep E); do zip archive.zip $file; done 

zip a folder

you have to zip our folder successfully.

conclusion: by reading this article we hope that you know that how to zip a directory in unix.

 

         

 

 

 

 

 

 

 

php max_execution_time

When you install PHP it executes in the default setting. Sometimes it is good for many websites. Sometimes your website needs different settings then you can change PHP settings. E.g. your website required heavy files to upload. But the default setting allows you to limit the upload files. For changing the settings you will create a ‘phprc’ file and change values. php Max_execution_time is the largest time in which a script is allowed to run before end. Default time is 30 seconds.

php max_execution_time:

Default time of execution is 30 seconds it will be too short for you. you can change this value by creating a phprc file. you can create a phprc file via FTP and SSH.

Creating phprc file via FTP:

  1. you login to your web server via FTP client. you are using file zilla for this process.

step 1 open file

  1. Ensure that you are in our correct directory. Otherwise your small problem going to be big problem.
  2. Click on .PHP file which you see that already exit.

step 2 php file

  1. In .PHP folder you can see that there are several other folders. Which are representing the version of PHP. For choosing the version from this folder. you should ensure that which version your site is using. For example your site using 7.4 and you should click on 7.4.

step 4 php versions

  1. In this directory you will see a phprc file. Right click on phprc file and choose view or edit.

step 5 edit phprc file

  1. After clicking on this file you can see the following lines of code which is open in your default editor. using this code you can change your php max_execution_time.

step 6 phprc code

  1. When you complete your task then you want to save your file then you see a pop up message. Which show that file is change and check box ‘finish edit and delete local files’. Now click on yes button.

step 7 save file

  1. When you complete these steps then check that any PHP process is in running form or not. If process is running then kill off all these process. Which are running in PHP.
  2. When you have to complete all steps and kill the PHP process. Now confirm that your files update or not. you can check by using phpinfo.php file.

If you have already phprc file then follow these steps:

10. Login to your server. Ensure that you are in correct directory to create file. Click right on file you see an option view and edit click on it.

step 10 edit file

11. After click on edit next prompt open asking him to choose the editor. you choose our default window editor notepad.

step 11 choose editor

12. After choose the editor notepad open. you can write here code.

step 12 write code

13. When you write your code then click on file and save this file.

step 13 save edit file

14. When you save your file within few seconds a new prompt open. you check the box and click on yes button.

Delete file:

15. Login to server via FTP.

16. Very important thing is that ensure that you are in correct directory or not.

17. Write click on file and click on delete.

step 17 delete file

18. When you complete your task he asking him to confirm the file delete or not click on yes button.

step 18 confirm delete

how to redirect a domain to another site

There are many ways to redirect the websites every website owner has its own technique to redirect his website. When we want how to redirect a domain to another site a question is rise that. When we redirect our domain does our mx record change or not. Answer is that our mx record will not change.

How to redirect a domain to another site

1. Redirect in c panel

                                 Sign in to cpanel and go to domain side, click on redirect icon.

redirect in cpanel

In Manu bar here are two types of redirect permanent (301) or temporary (302). We chose permanent (301) because it is place on server and browser level. 301 tells to the browser this is my permanent page and I don’t need to go back. 301 redirect is common, good and healthy for website. Search engine confess and index 301 redirect. And it is best for SEO. 302 redirect is use when we want to change our website in future. We use it for a short period. For a long period we can use 301.

permanent 301

2. Which domain redirect

In next step we select which domain we want to redirect. We can redirect all domains or simple choose one on which we redirect. In the first box we put our simple address e.g. example.com. But in the second box we add full address e.g. https://example.com/blogtest. To complete all these steps then click on add button. If we want to redirect www to non-www it will also redirect. E.g. if we want to redirect example.com then it will also redirect to www.example.com.

add link

3. Check Domain Redirect or Not

You can check that your domain is redirect or not. Below the add button you can see in current redirect box our redirected domains are shown below.

current directory

If you want to turn off your redirect you will be able to change in the host configuration.

Here some other helpful articles:

How To Redirect Http To Https

Contact Form 7 Not Sending Emails

how to redirect http to https

If you have SSL certificate in your website. Then you can automatic redirect your visitors HTTP to HTTPS for a secure connection. In HTTPS ‘S’ shows that your communication is secure. But how to redirect http to https?

For example:

https://arzhost.com

In this link‘s’ shows that arzhost website is secure.

There is nothing to do from your side. you enforce the site to use secure URL.

how to redirect http to https

For main domain enforce the SSL:

  1. Login to cPanel
  2. In domain side click on domains

domain section

  1. After click on domains page is open and you can see that there is an option you can enable or disable HTTPS redirect. you should leave to enable it. If there is no option to on it. Then SSL is not installed in your domain. Make sure that SSL is install or not if not installed then installed it.

enable https

If this section is on then your site is using HTTPS.

  1. Enforce the SSL for addon name.
  2. Linux using .htaccess files for redirection. you will need to create .htaccess file in your control panel file manager.
  3. In cpanel click on file manager.

on file manager

  1. In file manager section click on setting.

click on setting

  1. Ensure that show hidden file is check and save.

check box hidden files

  1. Click on public_html

click on public_html

  1. In public_html click on .htaccess

If you have .htaccess file good. If you have not then click on file and name the file .htaccess and create it.

create htaccess file

  • Select the file .htaccess and click edit

edit htaccess file

  • If you created .htaccess file, use this code for setup the URL redirect HTTPS version for your website.

 

<ifmudule mod_rewrite.c>

Rewriteengine on

Rewritebase /

Rewriterule  ^index\.php$  – [ L ]

Rewritecond  %{REQUEST_FILENAME}  ! – f

Rewritecond  %{REQUEST_FILENAME}  ! –  d

Rewriterule      .   /index.php   [ L ]

</ifmodule>

  • If .htaccess file is already exit then don’t make duplicate rewritrengine on.
  • Ensure that lines start with rewriteenginecond and rewiteRule
  1. Save changes and close it. That’s all.

 

 

 

 

 

How to Setup a Cron Job

Linux developers need to perform many tasks regularly or on a repeated basis that requires a bunch of time. In this scenario, they need to automate the tasks on a particular date, day, or time to avoid missing any task and save time.

A cron job is the best way to automate the repeated tasks as per needs and requirements. Developers widely use the cron tool for creating a cron job.

Usually, newbies want to automate their tasks, but they don’t know how to run the cron job. That’s why we will discuss the basics of a cron job and how to create a cron job in this article. Stay with us to understand the entire process simply and easily.

What is a Cron Job?

Cron is a Linux-based utility used for the scheduling of various tasks at a particular time or date. Usually, Linux developers use this tool widely for the execution of repeated tasks. For example, you make a rule to make a backup of your server every Monday morning. In that case, you can set a cron job instead of doing it manually every time.

You can use crop jobs to modify the files on the database or perform regular tasks like sending notifications or emails regularly.
It is easy to set up a cron job and if you want to know more about the setup process, then continue reading.

Components Parts of a Cron Job

Usually, any cron job comprises of three components:
A script that you have to run
A command that is required to run the script regularly
The output or action of the script based on the command of the script. Sometimes, most people don’t know how to setup a cron job Linux for running a script, provide you some specific setup instructions. That’s why, if you don’t know about it, then contact the author of the script before setting up the cron job.

How to Understand Cron Syntax?

A syntax is a group of instructions or rules that define various symbols in a system’s programming language to understand the command. That’s why, like other programming languages, cron job also uses syntax.
Understanding the syntax for a cron job makes it easier to set up the cron job. The following is the format of a cron syntax that you can use for a cron job:

A B C D E USERNAME /path/to/command arg1 arg2

In the above cron syntax:

A indicates minutes range from 0 to 59
B indicates hours range from 0 to 23
C indicates days range from 1 to 31
D indicates month range from 1 to 12 (Jan to Dec)
E indicates the day of a week from 1 to 6 (Sunday to Saturday)
Username indicates the account from where you do log in
/path/to/command refers to the script or command that you want to run

Also, you have to use some operator symbols that let you use multiple values in a single field.

These symbols are:
Asterisk (*) identifies all possible values for a field
The comma (,) identifies a list of values
Dash (-) is used for a range of values
Separator (/) identifies a step value

How to Create a Cron Job?

You can use either method mentioned below to create a cron job, i.e., set up a cron job using cPanel or set a cron job using Plesk. Let’s have a look at both methods one by one.

Setup a Cron Job Using cPanel

Follow the below-mentioned steps for creating the cron job in cPanel:

Login to cPanel at ARZHost

Click on a cron job in the advanced menu or search for a cron job
Update the email address for receiving the updates about the cron job
As you click on the cron job in the advanced menu, you can see the option “add a new cron job,” just click on it.
Provide the command either directly or by uploading the file containing commands.

Click on next and select the frequency of command in the command settings from the options available in the form of a drop-down list. You can also set the frequency by providing manual settings of time and date.
After finishing the setup, just hit the add new cron job button, and you are done with the process.

It is a simple process. You can create multiple cron jobs by repeating the entire process and providing different commands.

Setup a Cron Job Using Plesk

Plesk is an alternative for creating the cron job on Linux and windows based servers. Follow the following steps for understanding the process of creating a cron job using Plesk.

Login Plesk control panel at ARZHost

Click on the tools and settings option in server management that you can see on the left side of the dashboard
Click on scheduled tasks under the tab tools & resources and then click on Plesk administrator user
Click on add new tasks on the screen of scheduled tasks and provide the required information, including command line or path to the command file
Select the frequency of task by providing information about time, date, and month by using calendar under the section of task priority
After selecting the frequency of tasks, just hit OK to complete the process, and you are done with the process

Setting Up the Cron Job in WordPress

As we know, WordPress is the largest platform for building websites. That’s why it uses its built-in features for regulating different tasks like sending emails, notifications, taking updates, deleting junk messages, and many others.But some people like to outsource the cron job feature instead of using a built-in feature. It is due to a lack of reliability, in their opinion.

Although you can also create a cron job on the WordPress site using cPanel, we will let you know about creating the cron job using the WordPress plugin.

Follow the below-mentioned steps for understanding the entire process easily:

Step # 1,

Login to your WordPress dashboard and go to the plugins area. You can see the “add new plugin” button, click on it, and search for WP Control Plugin.

Download and install the plugin.

Step # 2,

After downloading the WP Control Plugin, you can see the option of events under the tools tab in the WordPress dashboard menu on the left. Here you can see the list of cron jobs, but you can see it blank if you had never created the cron job before.
Click on the add cron event tab next to the cron event tab. Here you can see different fields like name of cron event, frequency, and date, etc. Provide the information as per your needs and hit the add cron event button.

Step # 3,

As you complete adding a new cron event, you can see a newly created event in the list under the cron events tab. But you can also see the error “None” under the action column. It means you don’t set the action for this cron event.

You can add the following coding in the PHP file of the theme just under “ function cw_function() {
wp_mail( ‘info@example.com’, ‘new cron’,!’ );
}

You can access the PHP file of the theme in the dashboard of WordPress and edit it accordingly. After adding the file, hit the save button, and you are done with the process.

Conclusion

It is easy to create a cron job for performing repeating tasks, but it requires little attention. It helps save time and helps in completing important tasks on time, like backup or sending notifications. If you follow the instructions provided above, you can easily do it.
Hopefully, all the discussions in the above article help you understand the process of creating a cron job.

how to add another email account to outlook 2016

Outlook is a web base application it is like Gmail. It is a Microsoft application by using outlook you can send and receive emails from your pc. Outlook has two versions Microsoft express outlook and Microsoft outlook. Microsoft express outlook was first introduce in window 98 to window XP. Microsoft outlook have latest features and it is powerful then express. If you want to use extra features of Microsoft outlook you will be pay for it. If you want to use Microsoft outlook you should know that how to create account in Microsoft outlook. and how to add another email account to outlook 2016.

how to add another email account to outlook 2016

  • Open outlook from pc search Manu
  • Click on FILE

open file

  • Click on add account

click on add account

  • On the next step what we see it’s depend on our outlook version.
  • If our outlook version is Microsoft 365 and outlook 2016

enter email address

Enter your email address and connect

  • If our outlook version is 2010 and 2013 then it will be look like this

email address and possword

Enter your name, email address and password.

In outlook version 2016:

2016 version

  • Enter email address
  • Click on advanced option and check box to let me set up account manual.
  • Click on connect

choose IMAP

  • What we choose POP or IMAP, IMAP is best.

IMAP settings

  • On the next window we need to enter incoming mail and outgoing mail.
  • Server is our arzhost mail server. For incoming server we use ‘imap.arzhost.com. If we want to prefer POP connection then use ‘pop.arzhost.com’. Outgoing mail server is always ‘smtp.arzhost.com’.
  • We should use only arzhost mail server name. Avoid to use subdomain name. otherwise we will get insecure warning if we use incorrect hostname.
  • If we use IMAP then use port 993. For outgoing port we use 465 or 587.

Port 465 is recommend with SSL. But some email clients are unable to use it.

If it is unable to use it then port 587 is best with STARTTLS.

  • Click on Next button

IMAP password

  • Enter your password and click on connect button

successful added

  • If all these steps are successful then we will get setup.

 

 

 

 

 

 

 

 

Essential guidelines to Fix MySQL extension which is required by WordPress

Your PHP installation hence, all in all, appears to be lacking the MySQL extension error in WordPress. This is a complete frequent hassle if you are therefore putting up a WordPress CMS on a new and latest Linux VPS. The lacking the MySQL extension is much a regular hassle in view that the whole extension doesn’t come by default with so many different running systems. In this tutorial, we will be letting you know about how you can restore the trouble with the entire missing MySQL extension which is required by WordPress, as well as the whole WordPress installation successfully.

Missing an essential PHP extension is hence no longer something that you need to be concerned about. If you eventually visit the following message on your display as when attempting to access WordPress installation right through the internet browser, then you somehow one of the few major WordPress customers who are also dealing with a similar problem.

7 Essential Ways to Fix MYXQL Extension which is required by WordPress

  1. Connect SSH & Check the PHP Version

To fix up the issue, you should somehow have SSH access to the server. Connect it with your Linux VPS by SSH and yet check the PHP version which is currently being used:

  1. Use of Info.php File

You can even choose to check the PHP version by means of making a straightforward info.php right into your public_html directory. This is all done through the following context:

When you make the file, open your preferred internet browser and access the document.

  1. Update the necessary bundles

If in case you have been running an Ubuntu VPS and PHP 7, at that point run the following command:

  1. Restart the Web Server

At that point, restart your Apache service for the progressions to produce results, or in the event that you are using Nginx + PHP-FPM, at that point, restart the PHP-FPM service.

  1. Updating PHP

If in the condition that you are running the PHP 5, run the below-mentioned command:

You have to restart the suitable set of services for all the chances to take upon into effect.

  1. Searching available packages containing MySQL

PHP MySQL Extension

To look upon as through all the available packages that are containing PHP MySQL extension, you can somehow utilize this command:

Then once again, if you have been running a CentOS VPS and you have the PHP 7 installed right on your server, you have to use the below-mentioned command to deal with this issue:

  1. Restart Apache

Restart the Apache or even the PHP-FPM service inside the system, which you have been using upon as Nginx + PHP-FPM as being a web server.  In the event that you eventually have the PHP 5 installed on top of your CentOS server, you have to run the below-mentioned command:

Restart the necessary service for the sake of changes to take into the whole effect.   To search out for all the available packages that are containing MySQL, you can hence use the below-mentioned command:

Once you have all installed with the WordPress MySQL version extension for the PHP, you can easily make your way back to your whole WordPress setup. If the entire process of installation gets easy and smooth, the message related to the missing MySQL extension will not be presented in front of you.  You can, later on, continue yourself with the installation of your WordPress setup.

How can you easily fix the cPanel Server?

If you are on a cPanel server that you have root access to, you will need to enable and install the MySQL PHP module by the use of EasyApache four interfaces in your WHM. Here we have the step by step guide about it for your help:

Step 1: Log in to your WHM as root.

Step 2: Choose the option of “EasyApache 4”. You will see a web page as below:

search-for-easyapache-4-option-in-Cpanel

Step 3: You will see a highlighted field “Currently Installed Packages,” click on the ‘customize’ button as proven below:

customize-easyapache4-options

Step 4: Once there, choose ‘PHP Extensions,’ and in the search field kind MySQL, you will see the MySQL options, as considered below:

Search-for-PHP-MySQL-extension

Step 5: Select the required mysqlnd extension as per your requirement of the PHP versions. You can truly pick the entire model that is displayed, and this will cause no problems.

Step 6: Once you have chosen the MySQL extensions there click on “Review,” scroll down and click on “Provision” button, you will see the web page as below:

cpane-easyapache-4-review-page

easyapache-4-provision

Step 7: Once finished, click on the done option and check your WordPress set up and the error should be gone.

Step by Step Guide to easily fix Shared Hosting

If you have eventually set up WordPress on top of the shared web hosting account, this error is yet most in all likelihood is being prompted through the use of MySQL extension being disabled on your own web hosting account. In order to permit it, you have to follow the below-mentioned steps.

Step 1: You have to sign in with the cPanel account.

Step 2: Search for the option of “Select PHP Version” & then just click on it.

Step 3: Once there, trade the PHP model to Current from the dropdown as mentioned below:

change-PHP-version-to-native

Step 4: Once you have chosen the PHP version as current, tick on the alternative that says “mysqli” and/or “mysqlnd” from the choices introduced and clicks on save.cpanel-enable-PHP-MySQL-extensionStep 5: Check your WordPress set up and the error should be gone.

Step by step Guideline to fix on a CentOS Server

If you are somehow running your WordPress website on top of the CentOS VPS besides using any type of accessing the control panel, your first step needs to be all about to check the PHP model which you have been running.

# Hypertext Preprocessor -v

I Will display you the PHP Version you are presently running. In our case, this is PHP 7.0. We want to set up the PHP-MySQL extension for PHP 7.0. We can do this by the use of the following command:

# yum update

# yum set up php70w-MySQL

Once installed, restart your internet server, for Apache, it is:

systemctl restart httpd

Or

service httpd restart

After restarting, your WordPress website has to work correctly.

Important Guidelines to Repair on an Ubuntu Server

If you are running your WordPress website online on an Ubuntu VPS except for any sort of control panel, your first step would be to take a look at the PHP version that you are running as mentioned below:

# personal home page -v

PHP-MySQL extension for Php 7.0

I Will display you the PHP Version you are presently running. In our case, this is PHP 7.0. We want to installation the PHP-MySQL extension for Php 7.0. We can do this the use of the following command:

apt-get update

apt-get set up php7.0-mysql

Once installed, restart your internet server, for Apache, it is:

service httpd restart

After restarting, your WordPress web page must work properly.

Conclusion:

I hope this information will help you to get to the bottom of the trouble with your WordPress site! We have presented for you a complete guide of different methods to fix the mysql extension, which is required by WordPress. Follow all the significant steps carefully one by one!

See More

Create Virtual Environment Python 3

Redirect HTTP To HTTPS htaccess WordPress

The website owners need to know about the redirect of HTTP to HTTPS to improve the security feature of the website. Usually, a domain does not include the SSL certificate when initially purchased from the domain provider.

SSL certificate is essential to create a security layer around the domain, especially for eCommerce websites, to protect the payment information of online buyers.

WordPress is a convenient website builder widely used for developing websites. More than 25% of the site on the internet is developed with WordPress.

Along with the convenience in website building, there is a massive risk of hackers’ attack, especially on websites designed with WordPress. Therefore, it is necessary to use various safety measures on WordPress websites like SSL certificates.

What is HTTP?

HTTP is an abbreviation of (Hypertext Transfer Protocol) that is used to transfer the data and files in various formats on the World Wide Web (www). Usually, the URL of any website starts that starts with HTTP is marked as “not secure” in the domain bar.

It happens because it allows transferring any type of data without encryption, and it is easy for hackers to get access to data easily.

What are HTTPS and SSL?

HTTPS is an abbreviation of Hypertext Transfer Protocol Secured. It works in the same pattern just like HTTP, but it encrypts the data during communication between the client and the server.

It helps to enhance the security of the website. It is beneficial to keeps the hackers away from the site because it is secured with an SSL certificate.

The addition of “S” in HTTP represents the SSL (Secure Sockets Layer) certificate that is installed on the domain. It is used for data encryption purposes.

How to Force https WordPress?

Users can activate the SSL certificate manually or can use a WordPress plugin for this purpose. But we recommend using a plugin if you are a beginner to avoid any type of problem.

Keep in mind; don’t forget to take the backup of the database. It is beneficial to restore the settings in case of any problem.

Force HTTPS in WordPress by Using Plugin

It is the easiest way to redirect all traffic to https in WordPress. Different plugins are available for this purpose, but in this article, we are going to use “really simple SSL plugin.” This plugin is recommended and widely used by websites.

Follow the below mentioned simple steps to download and install the plugin:

Step # 1

Go to the dashboard of WordPress

301 redirect http to https htaccess

Step # 2

Go to plugins options in the right menu bar

redirect all traffic to https

Step # 3

Select add new plugin

htaccess force https and www

Step # 4

Search and install a really simple SSL plugin.

really simple SSL plugin for wordpress

Step # 5

Activate your plugin

activate really simple ssl plugin

After installing and activating the plugin click “Go Ahead, Activate SSL”, It automatically detects the SSL certificate and redirects your website to HTTPS.

how to force https wordpress

The most attractive part of using a plugin is that it automatically detects and fixes the HTTP errors in the content.

However, some drawbacks are also present for using the plugin. Plugins use a buffering technique to fix the content errors that can harm the performance of the website. But this impact can be reduced up to a certain level by using a caching plugin.

Keep in mind; you have to make sure that the plugin remains to activate all the time. Otherwise, your site will face mixed content errors.

Force HTTPS in WordPress Manually

This method is somehow tricky, but it is permanent, and the best solution for 301 redirect HTTP to https htaccess. But this method requires little knowledge about coding. If you don’t know about coding, then don’t worry, we will provide you codes and tell you how to implement it.

At first, you have to go on the settings option in the WordPress dashboard. Under the general settings, change the site URL in the fields and replace HTTP with HTTPS. After changing the protocol, save the settings, it will result in log out and asks you to login again.

At the next step, you have to add the following code in the .htaccess file of WordPress to redirect the site URL from HTTP to HTTPS.

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteCond %{HTTPS} off

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

</IfModule>

Nigix servers are getting popular nowadays due to efficiency in speed. If your hosting is on ARZ Host nigix servers, then add the following code.

server {

listen 80;

server_name example.com www.example.com;

return 301 https://example.com$request_uri;

}

Redirect http to https htaccess

After successful implementation of the above coding in the .htaccess file, your entire site works by using HTPPS without displaying any type of error. But if you want to force HTTPS and SSL on the admin area and login pages, then you have to configure the wp-config.php file for SSL.

For this purpose, add the following code in the wp-config.php file just above the “That’s all, stop editing!”.

define(‘FORCE_SSL_ADMIN’, true);

After completion of the process mentioned above, the SSL certificate is integrated completely in the website. But still, the website encounters the errors of mixed content.

Old HTTP Protocol

It could be due to different sources like images, style sheets, scripts, etc. because these are loading uses the old HTTP protocol. In this case, the browser doesn’t show a secured connection icon in the address bar.

However, the latest versions of browsers automatically detect and block the unsecured scripts and resources. These browsers show a secured connection icon in the address bar but with a notification.

Users can use the inspect tool to find out the mixed content errors and remove them from the website for better performance.

Conclusion

SSL certificate is vital to make your site secure and safe. But sometimes website owners don’t know the entire process, and as a result, they encounter different problems.

In the above article, we discuss the entire process simply and easily. You can do it either manually or by using the plugin by following the steps mentioned above.

90%OFF

New year Sale

Hurry Up! Offer ends in
days 01 02 hrs 23 00 mins 31 32 secs 02 03
Buy Now
We are offering a Discount Promotion on All VPS. you can get upto 75% DiscountBuy Now
+ +