{"id":746,"date":"2021-09-18T12:24:49","date_gmt":"2021-09-18T03:24:49","guid":{"rendered":"https:\/\/www.thinqa.net\/?p=746"},"modified":"2021-09-18T12:26:20","modified_gmt":"2021-09-18T03:26:20","slug":"aws-lightsail%e3%81%a7-htaccess%e3%82%92%e4%bd%bf%e3%81%84%e3%81%9f%e3%81%84","status":"publish","type":"post","link":"https:\/\/www.thinqa.net\/en\/2021\/09\/18\/746","title":{"rendered":"I want to use .htaccess in AWS Lightsail."},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I wanted to use .htaccess in Lightsail, so I made a note of it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To enable htaccess, you need to modify the following file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/opt\/bitnami\/apps\/wordpress\/conf\/httpd-app.conf<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;Directory \"\/opt\/bitnami\/apps\/wordpress\/htdocs\">\n    Options +MultiViews +FollowSymLinks\n    # AllowOverride None \u2190disable THIS\n    AllowOverride All \u2190Add this\n    &lt;IfVersion &lt; 2.3 >\n        Order allow,deny<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After fixing the above, restart apache.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ sudo \/opt\/bitnami\/ctlscript.sh restart apache<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The reason I wanted to use this was because I added the Bogo plugin to build a multilingual site with WordPress, but the URL of the multilingualized site was https:\/\/xxxx.xx\/, while I wanted the language name to be a subdirectory, like https:\/\/xxxx.xx\/en\/123 The reason for this is that the URL of the multilingualized site is now like ?lang=en, when I wanted it to be like with the language name as a subdirectory.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br><br>For this reason, after enabling the use of .htaccess in the above steps, make the .htaccess file writable with the following command, and then run<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">chmod 666 \/apps\/wordpress\/htdocs\/.htaccess<br><br>I made this possible by setting [Settings]-[Permalinks] in the WordPress admin panel as follows.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/%year%\/%monthnum%\/%day%\/%post_id%<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After the above settings, change the permissions back to the following.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">chmod 644 \/apps\/wordpress\/htdocs\/.htaccess<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I wanted to use .htaccess in Lightsail, so I made a note of it. To enable htaccess, you need to modify the following file. \/opt\/bitnami\/apps\/wordpress\/conf\/httpd-app.conf After fixing the above, restart apache. $ sudo \/opt\/bitnami\/ctlscript.sh restart apache The reason I wanted to use this was because I added the Bogo plugin to build a multilingual site &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.thinqa.net\/en\/2021\/09\/18\/746\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;I want to use .htaccess in AWS Lightsail.&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_locale":"en_US","_original_post":"https:\/\/www.thinqa.net\/?p=742","footnotes":""},"categories":[2],"tags":[],"class_list":["post-746","post","type-post","status-publish","format-standard","hentry","category-it","en-US"],"_links":{"self":[{"href":"https:\/\/www.thinqa.net\/wp-json\/wp\/v2\/posts\/746","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thinqa.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thinqa.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thinqa.net\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thinqa.net\/wp-json\/wp\/v2\/comments?post=746"}],"version-history":[{"count":3,"href":"https:\/\/www.thinqa.net\/wp-json\/wp\/v2\/posts\/746\/revisions"}],"predecessor-version":[{"id":749,"href":"https:\/\/www.thinqa.net\/wp-json\/wp\/v2\/posts\/746\/revisions\/749"}],"wp:attachment":[{"href":"https:\/\/www.thinqa.net\/wp-json\/wp\/v2\/media?parent=746"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thinqa.net\/wp-json\/wp\/v2\/categories?post=746"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thinqa.net\/wp-json\/wp\/v2\/tags?post=746"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}