チェ・ゲバムラの日記

脱犬の道を目指す男のブログ

【wordpress】サイトアドレスから/wp/とかを抜く方法

1.直下のhtaccessに追記

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^xmlrpc\.php$ "http\:\/\/0\.0\.0\.0\/" [R=301,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>


2.index.phpを↑にmvしつつ中身にwpを追記。

require( dirname( __FILE__ ) . '/wp/wp-blog-header.php' );

 

3.カスタム構造で/%category%/%postname%/

 

4.サイトアドレスからwpを消す

 

5.ドメイン直下にwpフォルダを入れてパーマリンクも変えた場合は下記をドメイン直下のhtaccessに追記。多分Basic認証とかの下あたり。

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