I made Wordpress on an Amazon Linux instance. At that time, I changed the permalink from basic to post name and tried to post the article, but I got an error saying "The response is not the correct JSON response" and I could not post & I could not display anything other than the top page.
The wordpress response is not the correct JSON response In the above article, I found that the apache setting was the cause.
sudo vi /etc/apache2/apache2.conf
As mentioned in the article, I tried to enter the configuration file with the above command, but there was no such file on Amazon Linux. This is because Amazon Linux is based on RedHat, while the above is a Debian configuration file.
reference http://www.linux.net-japan.info/install08.html https://www.acrovision.jp/service/aws/?p=653
There was a method in the AWS documentation. To enable WordPress to use permalinks
sudo vim /etc/httpd/conf/httpd.conf
<Directory" / var / www / html ">
. (* Be careful not to make a mistake because there are multiple AllowOverride lines. Be sure to look for the line in the <Directory" / var / www / html ">
section. Search for / html
in vim to find it immediately.)<Directory "/var/www/html">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
Change the above section to ʻAllowOverride None line to ʻAllowOverride All
. (None → All)
Save the file with: wq.
To reflect the above settings, restart with sudo systemctl restart httpd.service
. Check if it is active just in case with sudo systemctl status httpd.service
.
With the above settings, you can post articles and refer to pages other than the top page, even if the permalink is not basic.
Recommended Posts