Jump to content

ปัญหา Friendly Url ภาษาไทยยาวไป ใช้ไม่ได้ครับ


king888

Recommended Posts

พอดีพึ่งสังเกตุเห็นครับ ทั้งๆ ที่ Set Permission ถูกหมดแล้ว คือถ้า ภาษาไทยใน url มันยาวไป smarty จะไม่ write ให้ เพราะตัวอักษร มันเกิน ที่File System มันรับได้ ไม่ทราบว่าแก้ยังไงเหรอครับ ?

 

ตามข้างล่างนี้ จะ error ครับ

http://www.vitaminfast.com/home/3[spam-filter]ชุดของขวัญปีใหม่จาก-vistra-ซื้อ-3-ได้-4.html

Fatal error: Uncaught exception 'SmartyException' with message 'unable to write file /home/vitaminfast/public_html/cache/smarty/cache/ADTM^_home_391_E0_B8_8A_E0_B8_B8_E0_B8_94_E0_B8_82_E0_B8_AD_E0_B8_87_E0_B8_82_E0_B8_A7_E0_B8_B1_E0_B8_8D_E0_B8_9B_E0_B8_B5_E0_B9_83_E0_B8_AB_E0_B8_A1_E0_B9_88_E0_B8_88_E0_B8_B2_E0_B8_81_vistra_E0_B8_8B_E0_B8_B7_E0_B9_89_E0_B8_AD_3_E0_B9_84_E0_B8_94_E0_B9_89_4_html^5^^0^a35e0fbffbce41d52c8718463e8f6f3a86518cc2.pm_advancedtopmenu.tpl.php' in /home/vitaminfast/public_html/tools/smarty/sysplugins/smarty_internal_write_file.php:55 Stack trace: #0 /home/vitaminfast/public_html/tools/smarty/sysplugins/smarty_internal_cacheresource_file.php(102): Smarty_Internal_Write_File::writeFile('/home/vitaminfa...', 'writeCachedContent(Object(Smarty_Internal_Template), '

แต่ ถ้า Link สั้นๆจะไม่ Error จะเป็น Product not found แทน

http://www.vitaminfast.com/home/3[spam-filter]ชุดของ

Link to comment
Share on other sites

  • 2 weeks later...

รายการแรก ดูจากฝั่งผมก็ดูได้นะครับ ดูตามภาพที่ผม capture ครับ http://imm.io/ZqMk

 

เวอร์ชั่นอะไรครับ ถ้าเป็น 1.5 ก็ตามนี้ครับ

 

1. Override classes/Validate.php

return preg_match('/^[_a-zA-Z0-9\-\pL]+$/u', $link);

แก้เป็น

return preg_match('/^[_a-zA-Z0-9\-\pL\pM]+$/u', $link);

 

2. Override classes/Dispatcher.php

แก้ \pL ให้เป็น \pL\pM ทุกอัน (มี 28 อัน)

 

3. Override classes/Tools.php

แก้ \pL ให้เป็น \pL\pM

 

4. สำหรับ 1.5.3.0 หรือ 1.5.3.1 ให้เพิ่ม record โดยรัน SQL ที่ phpmysql

INSERT INTO `ps_configuration` (`id_shop_group`, `id_shop`, `name`, `value`, `date_add`, `date_upd`) VALUES  (NULL, NULL, 'PS_ALLOW_ACCENTED_CHARS_URL', '1', '2013-01-02 00:00:00', '2013-01-02 00:00:00')

Edited by Suthichai (see edit history)
Link to comment
Share on other sites

ไม่ทราบลองขั้นตอนเหล่านี้หรือยัง

1. ลบไฟล์ทั้งหมด (นอกจาก index.php) ใน cache/smarty/cache

2. clear browser cache

 

ถ้าใช้ DirectAdmin ให้เปิด File manager ดูที่ช่อง Action ว่ามีอะไรผิดสังเกตุหรือเปล่า ถ้ามีคำว่า Reset Owner แสดงว่าเราไม่ได้เป็นเจ้าของไฟล์ เนื่องจากเจ้าของไฟล์ดันเป็น Apache

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...