WordPress出現403 Forbidden訊息的解決方式

安裝完Wordpress 4.3版之後,一切順遂。然而,在改為多重網站的設定後,依照指示加入並更改.htaccess的設定:

=================================

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ – [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

===================================

之後,就出現403 Forbidden訊息:

======================================

Forbidden

You don’t have permission to access / on this server.

=======================================

以上,若將.htaccess刪除,看似可以順利運作,但新增網誌就會出現失敗的訊息,所以仍不可行。查了相關資料,終於在(https://wordpress.org/support/topic/access-forbidden-after-adding-htaccess-for-pretty-permalinks-mod_rewrite)發現到解決方式。

在第一行加入:

=============================

Options +SymLinksIfOwnerMatch

=============================

一切搞定。