2008年9月6日土曜日

PliggのSEO講座

PliggのSEOについて、最も効果的な方法を探っていきましょう。

最近の検索エンジンは私感ですが以前よりPHP(動的)サイトも登録されやすくなったと思います。私がホームページを作り始めたころはなかなか登録されなかった覚えがあります。それが原因で一時動的サイトを少し敬遠していた時期がありました。

ということで、今回は今まで作ってきたサイトを、このままだと動的サイトなので、静的に変え、尚且つsitemapを作成させるまでのカスタマイズします。

始める前に、ここで紹介してきた手順をこなし、ある程度サイトとして作製されていることを前提とし解説していきます。(少なくても目的のサイトのカテゴリは作成してください)

1.Xml Sitemaps Pligg moduleの組み込み

字の通りsitemapを作成するモジュールです。以下のサイトからダウンロードして解凍します。


Xml Sitemaps version 0.8 xml_sitemaps-0.9.zip / xml_sitemaps-0.9.tar.gz

解凍して出来たxml_sitemapsフォルダを丸ごとインストール先/modulesへアップします。

あなたのサイトからgodでログインして管理パネル>>モジュール管理でXml sitemaps v 0.9を探してインストールしてください。



2.htaccess.の設定

ディレクトリにあるhtaccess.defaultを開き以下の箇所を変更します。

##### 404 Error Begin ####### If Pligg is installed in a subfolder, change the below line to ErrorDocument 404 /name-of-subfolder/404error.phpErrorDocument 404 /404error.php##### 404 Error End #####



##### 404 Error Begin ####### If Pligg is installed in a subfolder, change the below line to ErrorDocument 404 /name-of-subfolder/404error.phpErrorDocument 404 /あなたのインストールしたディレクトリ/404error.php##### 404 Error End #####

##### Re-directing Begin #####Options +Indexes +FollowSymlinks -MultiViewsRewriteEngine on## If Pligg is installed in a subfolder, change the below line to RewriteBase /name-of-subfolderRewriteBase /## If installed in a subfolder you may need to add ## to the beginning of the next lineRewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/



##### Re-directing Begin #####Options +Indexes +FollowSymlinks -MultiViewsRewriteEngine on## If Pligg is installed in a subfolder, change the below line to RewriteBase /name-of-subfolderRewriteBase /あなたがインストールしたディレクトリ## If installed in a subfolder you may need to add ## to the beginning of the next line## RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/


## Remove these two lines if you have a sub-domain like http://ashdigg.pligg.com/ or http://localhost/## Keep if your site it like http://www.pligg.com/RewriteCond %{HTTP_HOST} !^www\.RewriteRule ^\/?(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]##### Re-directing End #####



## Remove these two lines if you have a sub-domain like http://ashdigg.pligg.com/ or http://localhost/## Keep if your site it like http://www.pligg.com/## RewriteCond %{HTTP_HOST} !^www\.## RewriteRule ^\/?(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]##### Re-directing End #####


##### You can find the below lines pre-made for you in the category management section of the admin panel ######RewriteRule ^(allpligg)/([^/]+)/?$ story.php?title=$2 [L]RewriteRule ^(allpligg)/?$ ?category=$1 [L] ####



##### You can find the below lines pre-made for you in the category management section of the admin panel ######RewriteRule ^(allpligg)/([^/]+)/?$ story.php?title=$2 [L]RewriteRule ^(allpligg)/?$ ?category=$1 [L]
ここにカテゴリを作成して出来た(カテゴリ管理ページの下に表示されています。)コードを貼り付け
#####

※9/7追記今後カテゴリを増やした場合は必ず.htaccessも書き換えてください。リンク切れの原因になります。

そして最終行に

##### URL Method 2 ("Clean" URLs) Begin #####RewriteRule ^story/([0-9]+)/?$ story.php?id=$1 [L]RewriteRule ^story/title/([^/]+)/?$ story.php?title=$1 [L]RewriteRule ^story/([0-9]+)/editcomment/([0-9]+)/?$ edit.php?id=$1&commentid=$2RewriteRule ^story/([0-9]+)/edit/?$ editlink.php?id=$1RewriteRule ^story/([0-9]+)/modify/([a-z]+)/?$ linkadmin.php?id=$1&action=$2RewriteRule ^recommend/([a-zA-Z0-9-]+)/?$ recommend.php?id=$1 [L]RewriteRule ^category/([^/]+)/?$ index.php?category=$1 [L]RewriteRule ^upcoming/category/([^/]+)/?$ upcoming.php?category=$1 [L]RewriteRule ^upcoming/([a-zA-Z0-9]+)/?$ upcoming.php?part=upcoming&order=$1RewriteRule ^inbox/?$ user.php?view=inboxRewriteRule ^user/?$ user.phpRewriteRule ^user/view/([a-zA-Z0-9-]+)/?$ user.php?view=$1RewriteRule ^user/view/([a-zA-Z0-9+]+)/([a-zA-Z0-9+]+)/?$ user.php?view=$1&login=$2RewriteRule ^user/view/([a-zA-Z0-9+]+)/login/([a-zA-Z0-9+]+)/?$ user.php?view=$1&login=$2RewriteRule ^user/([a-zA-Z-]+)/link/([0-9+]+)/?$ user_add_remove_links.php?action=$1&link=$2RewriteRule ^published/?$ index.phpRewriteRule ^published/([a-zA-Z0-9-]+)/?$ index.php?part=$1RewriteRule ^published/([a-zA-Z0-9-]+)/category/([a-zA-Z0-9_-]+)/?$ index.php?part=$1&category=$2RewriteRule ^upcoming/([a-zA-Z0-9-]+)/category/([a-zA-Z0-9_-]+)/?$ upcoming.php?part=upcoming&order=$1&category=$2RewriteRule ^search/(.+)/?$ search.php?search=$1RewriteRule ^searchurl/(.+)/?$ search.php?url=$1RewriteRule ^login/?$ login.phpRewriteRule ^login/([a-zA-Z0-9-]+)/?$ login.php?return=$1RewriteRule ^login/([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)/?$ login.php?return=$1/$2RewriteRule ^register/?$ register.phpRewriteRule ^topusers/?$ topusers.phpRewriteRule ^about/([a-zA-Z0-9-]+)/?$ faq-$1.phpRewriteRule ^upcoming/?$ upcoming.phpRewriteRule ^submit/?$ submit.phpRewriteRule ^rss/?$ rss.phpRewriteRule ^rss/([a-zA-Z0-9-]+)/?$ rss.php?status=$1RewriteRule ^rss/category/([a-zA-Z0-9_-]+)/?$ rss.php?category=$1RewriteRule ^rss/search/([a-zA-Z0-9-]+)/?$ rss.php?search=$1RewriteRule ^rss/user/([a-zA-Z0-9-]+)/?$ rss.php?user=$1RewriteRule ^rss/user/([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)/?$ userrss.php?user=$1&status=$2RewriteRule ^trackback/([0-9]+)/?$ trackback.php?id=$1 RewriteRule ^profile/?$ profile.phpRewriteRule ^admin/?$ admin_index.phpRewriteRule ^tagcloud/?$ cloud.phpRewriteRule ^tagcloud/range/([0-9]+)/?$ cloud.php?range=$1 [L]RewriteRule ^tag/(.+)/(.+)/?$ search.php?search=$1&tag=true&from=$2 [QSA,NC,L]RewriteRule ^tag/(.+)/?$ search.php?search=$1&tag=true [QSA,NC,L]RewriteRule ^live/?$ live.phpRewriteRule ^out/([^/]+)/?$ out.php?title=$1 [L]RewriteRule ^settemplate/?$ settemplate.phpRewriteRule ^comments/?$ live_comments.phpRewriteRule ^live_published/?$ live_published.phpRewriteRule ^unpublished/?$ live_unpublished.phpRewriteRule ^logout/([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)/?$ login.php?op=logout&return=$1/$2RewriteRule ^published/page/([^/]+)/?$ index.php?page=$1 [L]RewriteRule ^published/page/([^/]+)/category/([^/]+)/?$ index.php?page=$1&category=$2 [L]RewriteRule ^published/page/([^/]+)/([^/]+)category/([^/]+)/?$ index.php?page=$1&part=$2&category=$3 [L]RewriteRule ^upcoming/page/([0-9]+)/?$ upcoming.php?page=$1 [L]RewriteRule ^upcoming/page/([^/]+)/category/([^/]+)/?$ upcoming.php?page=$1&category=$2 [L]RewriteRule ^upcoming/page/([^/]+)/upcoming/([^/]+)/?$ upcoming.php?page=$1&part=upcoming&order=$2 [L]RewriteRule ^upcoming/page/([^/]+)/upcoming=([^/]+)category/([^/]+)/?$ upcoming.php?page=$1&part=upcoming&order=$2&category=$3 [L]RewriteRule ^topusers/page/([^/]+)/?$ topusers.php?page=$1 [L]RewriteRule ^topusers/page/([^/]+)/sortby/([^/]+)?$ topusers.php?page=$1&sortby=$2 [L]RewriteRule ^admin_links/page/([^/]+)/?$ admin_links.php?page=$1RewriteRule ^admin_comments/page/([^/]+)/?$ admin_comments.php?page=$1RewriteRule ^admin_users/page/([^/]+)/?$ admin_users.php?page=$1RewriteRule ^comments/page/([^/]+)/?$ live_comments.php?page=$1 [L]RewriteRule ^published/page/([^/]+)/?$ live_published.php?page=$1 [L]RewriteRule ^unpublished/page/([^/]+)/?$ live_unpublished.php?page=$1 [L]RewriteRule ^published/page/([^/]+)/([^/]+)/?$ index.php?page=$1&part=$2 [L]RewriteRule ^published/page/([^/]+)/range/([^/]+)/?$ ?page=$1&range=$2 [L]RewriteRule ^search/page/([^/]+)/search/([^/]+)/?$ search.php?page=$1&search=$2 [QSA,NC,L]RewriteRule ^user/page/([^/]+)/([^/]+)/([^/]+)/?$ user.php?page=$1&view=$2&login=$3 [L]RewriteRule ^statistics/page/([^/]+)/?$ module.php?module=pagestatistics&page=$1RewriteRule ^view/([^/]+)/?$ admin_users.php?mode=view&user=$1
RewriteRule ^sitemapindex.xml module.php?module=xml_sitemaps_show_sitemap [L]RewriteRule ^sitemap-([0-9a-z]+).xml module.php?module=xml_sitemaps_show_sitemap&i=$1 [L]
##### URL Method 2 ("Clean" URLs) End #####
以上でhtaccessの書き換えは終わりです。ここではリネームせずにそのままサーバーにアップします。


次に、あなたのサイト>>管理パネルの 設定の変更 を選んでください。


今回私の設定例を公開しますが、お使いのサーバーによって環境が多少違うと思いますのでご自身で確認いただくかどうしてもわからない場合はフォーラムのほうでわかる範囲でお答えします。



1.FriendlyURLsのFriendly URL's for storiesをfalseに変更

2.MiscのEnable Gzip File Compressionをtrueに※サーバー環境によって使えません。



3.OutGoingのOutgoing linksをfalseに

4.続けてOutgoing linksをurlに変更


5.UrlMethodのURL methodを2に変更

6.インストール先/htaccess.defaultをここで .htaccess にリネームします。

7.サイトの確認をしてください。
リンク切れはないか・・
静的アドレスになっているか
※以上のチェックでうまくいかない方は.htaccessに問題があります。環境に合わせて訂正してください。

8.sitemap.xmlの確認
http://インストル先/sitemap-0.xml
http://インストール先/sitemapindex.xml
にアクセスしてxmlが書かれていれば成功です。

次はgoogleやyahooに登録しましょう。
うまくいかない方はフォーラムへ

9 件のコメント:

匿名 さんのコメント...

Very great post. I simply stumbled upon your weblog and wished to mention that I have truly enjoyed surfing around your blog posts.
In any case I will be subscribing to your rss feed and I hope you write
once more soon!

my website ... sharepublish.com

匿名 さんのコメント...

keto pills work

匿名 さんのコメント...

Najnowsza Oferta zakładów sportowych WZB Milenium dostępne tutaj https://winwonwon.pl/legalni-bukmacherzy-w-polsce/milenium/

匿名 さんのコメント...

Najnowsza Oferta zakładów bukmacherskich Milenium dostępne na https://bonumart.pl/milenium-zaklady-bukmacherskie/

匿名 さんのコメント...

odwiedź https://innocomm.pl gdzie znajdziesz oferty chwilówek

匿名 さんのコメント...

kalendarze adwentowe 2020 gdzie ? kalendarze adwentowe na prezenty sprawdź oferte kalendarzy adwentowych

匿名 さんのコメント...

pomysły na prezenty świąteczne tanie prezenty świąteczne

匿名 さんのコメント...

sts zakłady

匿名 さんのコメント...

dobre tabletki na odchudzanie