How to Fix the 406 Error While Importing a Starter Template?

How to Fix the 406 Error While Importing a Starter Template?

While importing any template from the Starter Templates library, are you getting 『406 Not Acceptable』 error? If yes, this article will help you understand why it showed and how to fix it. 

Why Do You See This Error? 

While importing any template, your website needs to make a connection with the Starter Templates server. If your website doesn』t  accept connection with the Starter Templates server, you will get a 406 error. 

One of the reasons for this error is the website firewall which is blocking access to the Starter Templates server. 

How can you fix this?

As mentioned, this issue is related to your firewall. For the import to work, you need to make modifications that would allow the connection to go through. This can be done by your host or you can make modifications to your website yourself.

Contact your host

If you are not sure about modifying the website files yourself, we would suggest you contact your hosting provider to do this for you. This is the email template that you could use:

E-mail Template:

Hello,I』m building a WordPress website using the Astra theme. I』m trying to import a template using the 「Starter Templates」 plugin (https://wordpress.org/plugins/astra-sites/), but the process keeps failing. Here is the error notice I am receiving – Error: 406 Not AcceptableCan you please take a look? I』m looking forward to hearing from you.Thank you.Regards,Your name

Fix this yourself

To fix this issue yourself, you would need to edit your websites』 .htaccess file to disable the mod_security firewall.

Once you access your .htaccess file, you need to update (or add) the code between the 「Begin WordPress」 and 「End WordPress」 tags to match the one below:

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

There are several methods of editing your .htaccess file – either by using some plugins or using the FTP client and code editor. Choose one of the methods below which fits you the best.

Before making any changes to your .htaccess file, please create a complete backup of your website. Also, it is advisable to make a copy of the original file before editing it – in case something goes wrong you can always use this original file to start over.

Method 1 – edit the file using the 「Yoast」 plugin

Step 1 – Log in to your websites』 Dashboard

Step 2 – Navigate to the Dashboard > SEO > Tools

Step 3 – Click on the 「File Editor」

Step 4 – Edit the code in the .htaccess section and save changes

Step 5 – Try importing the starter template again

Method 2 – edit the file using the 「Rank Math」 plugin

Step 1 – Log in to your websites』 Dashboard

Step 2 – Navigate to the Dashboard > Rank Math > General Settings

Step 3 – Click on the 「Edit .htaccess」

Step 4 – Edit the .htaccess code and save changes

Step 5 – Try importing the starter template again

Method 3 – edit the file using the 「WP Htaccess Editor」 plugin

Step 1 – Log in to your websites』 Dashboard

Step 2 – Navigate to the Dashboard > Plugins > Add New

Step 3 – Install and Activate the WP Htaccess Editor plugin

Step 4 – Navigate to the Dashboard > Settings > WP Htaccess Editor

Step 5 – Edit the .htaccess code and save changes

Step 6 – Try importing the starter template again

Method 4 – edit the file using the FTP client

For this article, we』ll use the FileZilla FTP client, so please install it on your computer (unless you are familiar with another FTP client you would prefer to use). Let』s start:

Step 1 – Add your FTP access data to FileZillas』 Site Manager

Step 2 – Connect to your server

Step 3 – Navigate to your websites』 public_html (root) folder. Here you should find the .htaccess file. 

Do have in mind that the .htaccess file may be hidden so once you access your root directory using the FTP client, make sure you check the folder for the hidden files too. 

Now that you have found your .htaccess file, follow these steps to edit it:

Step 4 – Right-click on the file and select 「Download』 to copy the file to your computer.

Step 5 – Edit the file on your computer using some of the code editors like Sublime Text or Notepad++ (don』t use word processors like Microsoft Word or Google Docs for this). Open the file and add the code mentioned above. Save the file. Step 6 – Once you modified your file, just upload the file back to your server (using the FTP client) replacing the original file with this modified one, and your new values will become active.

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注