HanG321 Blog
Be Shine, Be Smile, Be Wild
  • Home
  • Blog
    • 好文閱讀 readings
    • 生活記事 diary
    • 時事評論 commentary
    • 科技資訊 technology
    • 電腦編程 programming
    • 金融財經 finance
    • 音樂電影 music/movie
  • About

migrate wordpress from sub-directory to root and update Permalinks

October 8, 2010|wordpress|科技資訊

Migrage from www.hang321.net/blog to www.hang321.net

1. backup
tar zcvf blog.`\bin\date +%Y%m%d`.tar.gz blog/

2. Move
mv * ../

3. edit wp_options table
LIKE %hang321.net/blog%
manually replace to hang321.net/ (could be done by sql too, but only couples of entries to modify)

4. change permalinks
change from ‘Numeric’ to ‘Day and name’, all links broken, especially from Google.
find a plugin, called permalinks-moved-permanently, generate a “301 Moved Permanently” to keep its pageRank
Not work because it look for postname, manually edit the query from post_name to ID

if( $ID = $wpdb->get_var( 'SELECT ID FROM '.$wpdb->posts.' WHERE ID = "'.$slug.'" AND post_status = "publish" ' ) ) {

Done!

Further Reading:

Moving a WordPress blog from a sub-directory to the root directory
http://www.rentablogger.com/blog/2009/01/23/moving-a-wordpress-blog-from-a-sub-directory-to-the-root-directory/
Permalinks Moved Permanently
http://wordpress.org/extend/plugins/permalinks-moved-permanently/

I told you

August 7, 2010|生活記事

有位同事講野開頭成日會講 “I told you XXX”, “I told you YYY”
雖然唔係好明, 不過都冇問點解

直到今日出去食lunch, 隔離枱一位國內黎既留學生不停講…
“我跟你講…”, “我講你聽….”
well, 唔使仙枕都可以解開呢個謎啦……

p.s. 我帶住headphone 都聽到佢地既對話…. 所以我知道佢地係學生….

Samba – record to myself only

July 26, 2010|DD-WRT, samba|生活記事

reading:

http://www.dd-wrt.com/wiki/index.php/Optware%2C_the_Right_Way
http://www.dd-wrt.com/wiki/index.php/Samba3

$ vi /opt/etc/init.d/S08samba

NAME=samba
samba_active=1
[ 1 = $samba_active ] || exit 0

## add user: steve
grep -q steve /etc/passwd || echo “steve:*:992:992:steve:/var:/bin/false” >> /etc/passwd
# add group
grep -q steve /etc/group || echo “steve:x:992:” >> /etc/group
# display chinese text in ssh shll
grep -q LANG /tmp/root/.profile || echo “export LANG=zh_TW.UTF-8” >> /tmp/root/.profile

$ smbpasswd -a steve

$ vi /opt/etc/samba/smb.conf

Fix some permission issue
$ find /somefolder -type d -exec chmod 775 {} \;
$ find /somefile -type f -exec chmod 664 {} \;

@MacBook
after mount, System Preferences > Account > login
mount sabma after you logged in

ref:
http://www.dd-wrt.com/phpBB2/viewtopic.php?p=334644#334644
http://dd-wrt.com/phpBB2/viewtopic.php?t=56439
http://hi.baidu.com/myeyre/blog/item/2b873d6d2198ebf1431694b3.html

...1020...26272829...50...

 

如果你喜歡我的文章,請幫忙按 1-10次 LikeButton 化讚為賞,非常感謝!越喜歡當然可以越按越多 😛

熱門文章 Popular Posts

  • Install XPEnology (DSM) 5.1 on ESXi 6 (HP MicroServer Gen 8)
    Install XPEnology (DSM) 5.1 on ESXi 6 (HP MicroServer Gen 8) June 8, 2015
  • 呢幾日個blogger 有問題….
    呢幾日個blogger 有問題…. October 28, 2004
  • assembly
    assembly February 11, 2006
  • 新工作
    新工作 January 6, 2009
  • 失望
    失望 April 3, 2006

標籤雲 Tag Cloud

amazon CentOS chroot DD-WRT Debian Domino DSM DWA ebook ebook calibre ESXi GCP git google gradle groovy HTML5 IE Java Javascript javscript Jenkins LikeCoin Linux log LotusScript mint MySQL N36L nanoboot nginx PowerShell Qwiklabs responsive route Tomcat VMware vpn vSphere wordpress XPEnology 專欄 網絡資訊 選股 風帆

日曆 Calendar

December 2026
M T W T F S S
  « Feb    
 123456
78910111213
14151617181920
21222324252627
28293031  

Follow Me

Follow Us on RSSFollow Us on TwitterFollow Us on YouTube

文章存檔 Archives

Copyright © 2004-2021 hang321.net. All Rights Reserved