{"id":2301,"date":"2019-07-17T14:37:25","date_gmt":"2019-07-17T14:37:25","guid":{"rendered":"https:\/\/chemicloud.com\/kb\/?post_type=ht_kb&#038;p=2301"},"modified":"2020-03-25T14:42:29","modified_gmt":"2020-03-25T14:42:29","slug":"wordpress-htaccess","status":"publish","type":"ht_kb","link":"https:\/\/chemicloud.com\/kb\/article\/wordpress-htaccess\/","title":{"rendered":"WordPress .htaccess"},"content":{"rendered":"<p>The .htaccess is a configuration file and is how a web browser (Apache, NGINX, LiteSpeed) handles configuration changes on a per-directory basis.<\/p>\n<p>WordPress uses this file to manipulate how the webserver serves files from its root directory and subdirectories thereof.<\/p>\n<p>This page may be used to restore a corrupted .htaccess file (e.g. a misbehaving plugin).<\/p>\n<h3 id=\"basic-wordpress-htaccess\">Basic WordPress .htaccess<\/h3>\n<pre># BEGIN WordPress\r\n\r\nRewriteEngine On\r\nRewriteBase \/\r\nRewriteRule ^index\\.php$ - [L]\r\nRewriteCond %{REQUEST_FILENAME} !-f\r\nRewriteCond %{REQUEST_FILENAME} !-d\r\nRewriteRule . \/index.php [L]\r\n\r\n# END WordPress<\/pre>\n<h3 id=\"wordpress-multisite\">WordPress Multisite<\/h3>\n<p>If you activated Multisite on WordPress 3.5 or later, use one of the below .htaccess rules:<\/p>\n<h4 id=\"subfolder-example\">Subfolder Example<\/h4>\n<pre class=\"wp-block-preformatted\">RewriteEngine On\r\nRewriteBase \/\r\nRewriteRule ^index\\.php$ - [L]\r\n\r\n# add a trailing slash to \/wp-admin\r\nRewriteRule ^([_0-9a-zA-Z-]+\/)?wp-admin$ $1wp-admin\/ [R=301,L]\r\n\r\nRewriteCond %{REQUEST_FILENAME} -f [OR]\r\nRewriteCond %{REQUEST_FILENAME} -d\r\nRewriteRule ^ - [L]\r\nRewriteRule ^([_0-9a-zA-Z-]+\/)?(wp-(content|admin|includes).*) $2 [L]\r\nRewriteRule ^([_0-9a-zA-Z-]+\/)?(.*\\.php)$ $2 [L]\r\nRewriteRule . index.php [L]\r\n<\/pre>\n<h4 id=\"subdomain-example\">SubDomain Example<\/h4>\n<pre class=\"wp-block-preformatted\">RewriteEngine On\r\nRewriteBase \/\r\nRewriteRule ^index\\.php$ - [L]\r\n\r\n# add a trailing slash to \/wp-admin\r\nRewriteRule ^wp-admin$ wp-admin\/ [R=301,L]\r\n\r\nRewriteCond %{REQUEST_FILENAME} -f [OR]\r\nRewriteCond %{REQUEST_FILENAME} -d\r\nRewriteRule ^ - [L]\r\nRewriteRule ^(wp-(content|admin|includes).*) $1 [L]\r\nRewriteRule ^(.*\\.php)$ $1 [L]\r\nRewriteRule . index.php [L]<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The .htaccess is a configuration file and is how a web browser (Apache, NGINX, LiteSpeed) handles configuration changes on a per-directory basis. WordPress uses this file to manipulate how the webserver serves files from its root directory and subdirectories thereof. This page may be used to restore a corrupted .htaccess&#8230;<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"ht-kb-category":[40],"ht-kb-tag":[],"class_list":["post-2301","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-wordpress"],"_links":{"self":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/2301","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/comments?post=2301"}],"version-history":[{"count":1,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/2301\/revisions"}],"predecessor-version":[{"id":2302,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/2301\/revisions\/2302"}],"wp:attachment":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/media?parent=2301"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb-category?post=2301"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb-tag?post=2301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}