blogのURLを変更しました。

http://kurusugawa.jp/blog を http://kurusugawa.jp/ に変更しました。
しばらくは http://kurusugawa.jp/wordpress でもアクセスできるようにします。

wordpressのURLを変更するのは結構大変ですね。

読者からの反応 (3 件)

  1. squld squld より:

    MySQLで直接クエリ実行して

    エントリやら

    update wp_posts set post_content = replace(post_content,'/wordpress/','/blog/');
    

    コメントやら

    update wp_comments set comment_content = replace(comment_content,'/wordpress/','/blog/');
    

    リンクを書き換えました。

    置換機能使った方が早かったかも。

  2. squld squld より:

    やっぱだめ。
    wordpressの置換機能はURL置換には使えない。
    https://kurusugawa.jphttp://kurusugawa.jp に置換したら、置換対象になった行のダブルクオート(”)が バックスラッシュ + ダブルクオート(\”)になってしまった。
    余計なお世話。

  3. squld squld より:

    それから、URLだけでなくディレクトリも移動した場合はMySQLを使ってwp_postmetaの置換も必要。

    内容はこんな感じ。

    mysql> select * from wp_postmeta;
    +---------+---------+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | meta_id | post_id | meta_key                | meta_value                                                                                                                                                                                                      |
    +---------+---------+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    |       8 |      12 | _wp_attached_file       | /var/www/html/blog/wp-content/uploads/2007/04/water-lilies.jpg                                                                                                                                                  |
    |       9 |      12 | _wp_attachment_metadata | a:4:{s:5:"width";i:800;s:6:"height";i:600;s:14:"hwstring_small";s:23:"height='96' width='128'";s:4:"file";s:67:"/var/www/html/blog/wp-content/uploads/2007/04/water-lilies.jpg";}                               |
    |      57 |      50 | _wp_attached_file       | /var/www/html/blog/wp-content/uploads/2007/05/syntaxtree.PNG                                                                                                                                                    |
    |      58 |      50 | _wp_attachment_metadata | a:4:{s:5:"width";i:180;s:6:"height";i:220;s:14:"hwstring_small";s:22:"height='96' width='78'";s:4:"file";s:65:"/var/www/html/blog/wp-content/uploads/2007/05/syntaxtree.PNG";}                                  |
    |      69 |      57 | _wp_attached_file       | /var/www/html/blog/wp-content/uploads/2007/05/10021259080.jpg                                                                                                                                                   |
    |      70 |      57 | _wp_attachment_metadata | a:4:{s:5:"width";i:800;s:6:"height";i:600;s:14:"hwstring_small";s:23:"height='96' width='128'";s:4:"file";s:66:"/var/www/html/blog/wp-content/uploads/2007/05/10021259080.jpg";}                                |
    |      98 |      75 | _wp_attached_file       | /var/www/html/blog/wp-content/uploads/2007/05/tinymce.zip                                                                                                                                                       |
    
    ~~略~~
    
    +---------+---------+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    132 rows in set (0.00 sec)
    

コメントをどうぞ

関連投稿


ホーム | RSS | 採用情報 | 会社情報