>>>>เอาวิธีทำ URL เป็นภาษาไทยสำหรับ SEO ของ SMF 2.0 ขึ้นไป มาฝากครับ<<<<

เริ่มโดย medusakbpom, 09 กันยายน 2012, 18:26:16

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

HaChi

อ้างถึงจาก: medusakbpom ใน 09 กันยายน 2012, 18:26:16
mod rewrite friendly url ภาษาไทยสำหรับ SEO ของ SMF 2.0 ขึ้นไปครับ ผมลองทำแล้ว ได้ผมแจ่มมากครับ
ทำให้ url เป็นภาษาไทยแล้วมี.html ตามหลังด้วยครับ
ลองทำเมื่อกี้นี่เอง ทำได้แล้วเลยเอามาแบ่งให้คนที่ยังทำไม่ได้ไปลองทำดูครับ

1. Login เข้าสู่ระบบ ไปที่เมนูผู้ดูแล จากนั้นเลือก
ส่วนปรับแต่งค่าการใช้งาน > คลิ๊กที่แสดง URLs โดยปราศจาก ?'s Apache เท่านั้น!
Login as Admin > Edit Features and Options >  Show URL's without ?'s

Search engine friendly URLs
Apache/Lighttpd only!

2. แก้ไขไฟล์ ./Source/MessageIndex.php

ค้นหา
'time' => timeformat($row['first_poster_time']),
'timestamp' => forum_time(true, $row['first_poster_time']),
'subject' => $row['first_subject'],
'preview' => $row['first_body'],
'icon' => $row['first_icon'],
'icon_url' => $settings[$context['icon_sources'][$row['first_icon']]] . '/post/' . $row['first_icon'] . '.gif',
'href' => $scripturl . '?topic=' . $row['id_topic'] . '.0',
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['first_subject'] . '</a>'


เอาไปทับของเดิม

'time' => timeformat($row['first_poster_time']),
'timestamp' => forum_time(true, $row['first_poster_time']),
'subject' => $row['first_subject'],
'preview' => $row['first_body'],
'icon' => $row['first_icon'],
'icon_url' => $settings[$context['icon_sources'][$row['first_icon']]] . '/post/' . $row['first_icon'] . '.gif',
'href' => $scripturl . '?topic=' . $row['id_topic'] . '.0',
$keyword= preg_replace("~[\s]+~","-",$row['first_subject']),
$keyword = urlencode(preg_replace('~[^a-z0-9ก-๙\.\-\_]~iu','',$keyword)),
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0/' . str_replace(" ","-",$row['first_subject']) . '" target="_blank">' . $row['first_subject'] . '</a>'
/*'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0[color=red][b]/' . urlencode(preg_replace('~[^a-z0-9ก-๙\.\-\_]~iu','',$keyword)) . '[/b][/color]">' . $row['first_subject'] . '</a>'*/
/*'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0/' . urlencode($keyword) . '" target="_blank">' . $row['first_subject'] . '</a>'*/


3. Save as
แล้วอัพไฟล์ขึ้นโฮสไปทับของเดิมครับ

ขอบคุณ jigload.com

***ผมไม่ต้องการอะไรมากมาย ขอแค่ คำขอบคุณ และ +1 ก็พอครับ ^^  :wanwan017:





ใช้ 2RC3 โมเรียบร้อยแล้วไม่มีอะไรเปลี่ยนแปลงอ่ะครับ  ???
ลิงค์ยังเหมือนเดิม ต้องทำอะไรเพิ่มเติมอีกหรือเปล่า ??
อย่างไรก็ขอบคุณครับ +1


อ้างถึงจาก: hs4twy ใน 09 กันยายน 2012, 20:40:31
http://www.thaiseoboard.com/index.php?topic=64551.0

ไม่มีอะไร แค่อยากให้เห็น

ขอบคุณคุณหูกางด้วยเช่นกันครับ


medusakbpom

อ้างถึงจาก: HaChi ใน 15 กันยายน 2012, 12:41:09
เจอ error log แบบนี้

Undefined index: firstSubject

ของผม 2.0 CR5 ก็ทำได้ปกตินะครับ ทำแล้วลองให้คนอื่นเข้าดูให้ครับ
เพราะตอนแรกผม ทำแล้วในเครื่องตัวเอง url ก็เป็นเหมือนเดิมครับ
แต่ลองให้คนอื่นเข้าดู url เปลี่ยนเป็นภาษาไทยครับ

jamess2600


[direct=http://xn--q3can3a1an7a4b1ee9fe.com/]หาเพื่อน เฟสบุ๊ค ไลน์ เล่นเกม[/direct]

kanesz12

https://privateladyescorts.com - Secret Live Dating - No Selfie - Anonymous Casual Dating -   Authentic Dating


pharaoh_za

[direct=https://www.marketdogs.com]ซื้อขายหมา ขายสุนัข ขายหมา ซื้อหมา ซื้อขายสุนัข[/direct][direct=http://www.marketbirds.com/]ซื้อขายนก ขายนก ซื้อนก[/direct][direct=https://www.thaipedigree.com]ใบเพ็ดดีกรี[/direct][direct=https://mdogs.app/]ตลาดซื้อขายหมา[/direct][direct=https://petai.me/]AI เพื่อสัตว์เลี้ยง[/direct]

godzilla777