WordPressに.htaccessを追加すると500内部サーバーエラーが発生する

WordPressに.htaccessを追加すると500内部サーバーエラーが発生する

私はWordPress Webサイトを新しい専用ホストに移行しています。

資産を正常に移動し、それをWordPressデータベースにインポートしました。

wp_optionsを一時ドメイン名に更新しました(移行準備が整うまで)。

しかし、.htaccessファイルを追加すると、http://xxxxx.com/wp-admin/'

私が見たページですが..

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

.htaccessファイルは次のとおりです。

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

私は、これが部分的にポート80のApache Webサーバーディレクティブで見逃した部分だと思います。

これは私が設定したものです...

DocumentRoot "/usr/share/wordpress"   
<Directory "/usr/share/wordpress">
 Allow From All                                           
 Options None                                             
 Require all granted                                      
</Directory>

これは私のApache設定です..

Apache

現在、ポート 443 に設定されたディレクティブはありません。ただこれだけです。

DocumentRoot /usr/share/wordpress 
ErrorLog /var/log/httpd/error.log      
CustomLog /var/log/httpd/access.log combined 
UseCanonicalName off 

サーバーの前に証明書値を削除しておきました。

私は何を見逃していますか?

ベストアンサー1

Apache設定で「AllowOverride All」を追加して保存し、Apacheを再起動してもう一度やり直してください。

前任者:

DocumentRoot "/usr/share/wordpress"   
<Directory "/usr/share/wordpress">
 Allow From All
 AllowOverride All                                           
 Options None                                             
 Require all granted                                      
</Directory>

詳細については、次を参照してください。 https://httpd.apache.org/docs/2.4/mod/core.html#AllowOverride

おすすめ記事