WordPress fix rest_cannot_create


I have been working on App Development project for a client. We use Authorization Access token
to validate our users and inputs. Suddenly the Rest API of WordPress started returning an error,
 "{"code":"rest_cannot_create","message":"Sorry, you are not allowed to create posts as this ".
And all our APIs stopped working. After spending some time over the internet we found out a solution,
and thought to share it will you all.



This issue arises when some automatically modifications are done in .htaccess file just because of installation of new wordpress plugin.
Due to this issue you are not allowed to create any post and you are not authorized to update the 
details related to specific post and due to this issue Authorization bearer token is also not accessible.



The solution of this issue is simple,we only have to make some changes in .htaccess file which are 
as follows
after the RewriteEngine On
you have to add two lines which are as follows
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1] 
that's it now you are good to go.