前提
さくらのVPS、KUSANAGIにてWordPressを構築しております。
Webサーバーはnginxです。
WordPressは、
ルートではなく、/app/以下に格納しております。
http://xxx.xxx.com/news/
にアクセスすると、403ページが表示されます。
発生している問題
htaccessのRewriteRuleを下記のように設定しておりました。
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_URI} /news/ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule . /index.php [L] </IfModule>
下記エラーログ
directory index of "/home/kusanagi/xxx-xxx.com/DocumentRoot/news/" is forbidden,
newsというディレクトリに来たら、トップのindex.phpに飛ばしてテーマ内を見に行くという設定です。
試したこと
location / { rewrite /about/ /index.php break; rewrite /contact/ /index.php break; }
location = /news/ { try_files $uri $uri/ ../../index.php?$args; }
どっちも403になりました。
nginxでのリダイレクト?設定のやり方をご教授いただけましたらと思います。
よろしくおねがいします。

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/02/20 09:33