前提・実現したいこと
ワードプレスのダッシュボードに入りたいのですが、ログインすると何故かトップページへ遷移してしまいます。
サイト自体は表示されてはいるのですが、管理画面に入れない為なにもできなくて困っています。
通常通りダッシュボードへログインできるようにできればと思います。
発生している問題・エラーメッセージ
1.wp-login.phpからログイン ⇒ サイトトップページへ遷移
2.wp-admin/からログイン ⇒ このページにアクセスする権限がありません。
試したこと
1.バックアップしてあったhtaccessファイルを上書き ⇒ 変化なし
2.データベース内に管理者権限をもったアカウントを作成しログイン ⇒ ログインはできるが「トップページに遷移し、上部にワードプレスの管理バーが出るのみ」
3.wp-cinfig.phpも正常だった時のファイルに上書き ⇒ 変化なし
≪htaccessの変更点≫
※wpフォルダと同じ階層のhtaccessと一つ上の階層のhtaccessを変更しました。
【WPと同じ階層のhtaccess】 〇変更前 <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_ACCEPT} image/webp RewriteCond %{REQUEST_FILENAME} (.*).(jpe?g|png)$ RewriteCond %{REQUEST_FILENAME}.webp -f RewriteCond %{QUERY_STRING} !type=original RewriteRule (.+).(jpe?g|png)$ %{REQUEST_FILENAME}.webp [T=image/webp,E=accept:1,L] </IfModule> <IfModule mod_headers.c> Header append Vary Accept env=REDIRECT_accept </IfModule> AddType image/webp .webp <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] RewriteCond %{HTTP_HOST} ^サイトドメイン.com RewriteRule ^(.*) https://www.サイトドメイン$1 [R=301,L] </IfModule> # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wp/ RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wp/index.php [L] </IfModule> # END WordPress <IfModule mod_headers.c> <FilesMatch ".(ico|jpe?g|png|gif|svg|swf|webp|ttf|woff|woff2|otf|eot)$"> Header set Cache-Control "max-age=31557600, public" </FilesMatch> <FilesMatch ".(css|js)$"> Header set Cache-Control "max-age=31557600, public" </FilesMatch> # プロキシサーバーが間違ったコンテンツを配布しないようにする Header append Vary Accept-Encoding env=!dont-vary </IfModule> RewriteEngine On RewriteRule ^.toilet_top/$ - [R=404,L] 〇変更後 <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_ACCEPT} image/webp RewriteCond %{REQUEST_FILENAME} (.*).(jpe?g|png)$ RewriteCond %{REQUEST_FILENAME}.webp -f RewriteCond %{QUERY_STRING} !type=original RewriteRule (.+).(jpe?g|png)$ %{REQUEST_FILENAME}.webp [T=image/webp,E=accept:1,L] </IfModule> <IfModule mod_headers.c> Header append Vary Accept env=REDIRECT_accept </IfModule> AddType image/webp .webp <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] RewriteCond %{HTTP_HOST} ^サイトドメイン.com RewriteRule ^(.*) https://サイトドメイン$1 [R=301,L] </IfModule> # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wp/ RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wp/index.php [L] </IfModule> # END WordPress <IfModule mod_headers.c> <FilesMatch ".(ico|jpe?g|png|gif|svg|swf|webp|ttf|woff|woff2|otf|eot)$"> Header set Cache-Control "max-age=31557600, public" </FilesMatch> <FilesMatch ".(css|js)$"> Header set Cache-Control "max-age=31557600, public" </FilesMatch> # プロキシサーバーが間違ったコンテンツを配布しないようにする Header append Vary Accept-Encoding env=!dont-vary </IfModule> RewriteEngine On RewriteRule ^.toilet_top/$ - [R=404,L] order deny,allow deny from all allow from 123.456.789 【WPフォルダの一つ上の階層のhtaccess】 〇変更前 # BEGIN WpFastestCache <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTPS} =on RewriteCond %{HTTP_HOST} ^サイトドメイン # Start WPFC Exclude RewriteCond %{REQUEST_URI} !/mail [NC] RewriteCond %{REQUEST_URI} !/check [NC] RewriteCond %{REQUEST_URI} !/check2 [NC] RewriteCond %{REQUEST_URI} !/check3 [NC] RewriteCond %{REQUEST_URI} !/ccomplete [NC] RewriteCond %{REQUEST_URI} !/ccomplete2 [NC] RewriteCond %{REQUEST_URI} !/complete3 [NC] # End WPFC Exclude # Start_WPFC_Exclude_Admin_Cookie RewriteCond %{HTTP:Cookie} !wordpress_logged_in_[^\=]+\=WPユーザー名 # End_WPFC_Exclude_Admin_Cookie RewriteCond %{HTTP_HOST} ^サイトドメイン RewriteCond %{HTTP_USER_AGENT} !(facebookexternalhit|Twitterbot|LinkedInBot|WhatsApp|Mediatoolkitbot) RewriteCond %{HTTP_USER_AGENT} !(WP\sFastest\sCache\sPreload(\siPhone\sMobile)?\s*Bot) RewriteCond %{REQUEST_METHOD} !POST RewriteCond %{REQUEST_URI} !(/){2}$ RewriteCond %{REQUEST_URI} /$ RewriteCond %{QUERY_STRING} !.+ RewriteCond %{HTTP:Cookie} !wordpress_logged_in RewriteCond %{HTTP:Cookie} !comment_author_ RewriteCond %{HTTP:Cookie} !safirmobilswitcher=mobil RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC] RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/all/$1/index.html -f [or] RewriteCond /var/www/html/wp/wp-content/cache/all/$1/index.html -f RewriteRule ^(.*) "/wp/wp-content/cache/all/$1/index.html" [L] </IfModule> <FilesMatch "index.(html|htm)$"> AddDefaultCharset UTF-8 <ifModule mod_headers.c> FileETag None Header unset ETag Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" Header set Pragma "no-cache" Header set Expires "Mon, 29 Oct 1923 20:30:00 GMT" </ifModule> </FilesMatch> # END WpFastestCache # BEGIN GzipWpFastestCache <IfModule mod_deflate.c> AddType x-font/woff .woff AddType x-font/ttf .ttf AddOutputFilterByType DEFLATE image/svg+xml AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE application/x-font-ttf AddOutputFilterByType DEFLATE x-font/ttf AddOutputFilterByType DEFLATE application/vnd.ms-fontobject AddOutputFilterByType DEFLATE font/opentype font/ttf font/eot font/otf </IfModule> # END GzipWpFastestCache # BEGIN WordPress # `BEGIN WordPress` から `END WordPress` までのディレクティブ (行) は # 動的に生成され、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 RewriteEngine On RewriteRule ^.toilet_top/$ - [R=404,L] 〇変更後 # BEGIN WpFastestCache <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTPS} =on RewriteCond %{HTTP_HOST} ^サイトドメイン # Start WPFC Exclude RewriteCond %{REQUEST_URI} !/mail [NC] RewriteCond %{REQUEST_URI} !/check [NC] RewriteCond %{REQUEST_URI} !/check2 [NC] RewriteCond %{REQUEST_URI} !/check3 [NC] RewriteCond %{REQUEST_URI} !/ccomplete [NC] RewriteCond %{REQUEST_URI} !/ccomplete2 [NC] RewriteCond %{REQUEST_URI} !/complete3 [NC] # End WPFC Exclude # Start_WPFC_Exclude_Admin_Cookie RewriteCond %{HTTP:Cookie} !wordpress_logged_in_[^\=]+\=WPユーザー名 # End_WPFC_Exclude_Admin_Cookie RewriteCond %{HTTP_HOST} ^サイトドメイン RewriteCond %{HTTP_USER_AGENT} !(facebookexternalhit|Twitterbot|LinkedInBot|WhatsApp|Mediatoolkitbot) RewriteCond %{HTTP_USER_AGENT} !(WP\sFastest\sCache\sPreload(\siPhone\sMobile)?\s*Bot) RewriteCond %{REQUEST_METHOD} !POST RewriteCond %{REQUEST_URI} !(/){2}$ RewriteCond %{REQUEST_URI} /$ RewriteCond %{QUERY_STRING} !.+ RewriteCond %{HTTP:Cookie} !wordpress_logged_in RewriteCond %{HTTP:Cookie} !comment_author_ RewriteCond %{HTTP:Cookie} !safirmobilswitcher=mobil RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC] RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/all/$1/index.html -f [or] RewriteCond /var/www/html/wp/wp-content/cache/all/$1/index.html -f RewriteRule ^(.*) "/wp/wp-content/cache/all/$1/index.html" [L] </IfModule> <FilesMatch "index.(html|htm)$"> AddDefaultCharset UTF-8 <ifModule mod_headers.c> FileETag None Header unset ETag Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" Header set Pragma "no-cache" Header set Expires "Mon, 29 Oct 1923 20:30:00 GMT" </ifModule> </FilesMatch> # END WpFastestCache # BEGIN GzipWpFastestCache <IfModule mod_deflate.c> AddType x-font/woff .woff AddType x-font/ttf .ttf AddOutputFilterByType DEFLATE image/svg+xml AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE application/x-font-ttf AddOutputFilterByType DEFLATE x-font/ttf AddOutputFilterByType DEFLATE application/vnd.ms-fontobject AddOutputFilterByType DEFLATE font/opentype font/ttf font/eot font/otf </IfModule> # END GzipWpFastestCache # BEGIN WordPress # `BEGIN WordPress` から `END WordPress` までのディレクティブ (行) は # 動的に生成され、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 RewriteEngine On RewriteRule ^.toilet_top/$ - [R=404,L] order deny,allow deny from all allow from 123.456.789
・導入プラグインは「WpFastestCache」「really-simple-ssl」「wp-scss」です。
・index.phpの変更などはありません。
※4/27追記
データベースを初期化して、ワードプレスインストール後の初期状態のsqlファイルをインポートするとダッシュボードへアクセスできました。(wp-contents/wp-admin/wp-inculudなどのファイル類は何も変更せず)