ThaiSEOBoard.com

พัฒนาเว็บไซต์ => CMS & Free Script => ข้อความที่เริ่มโดย: Fallen ที่ 21 สิงหาคม 2018, 21:30:24



หัวข้อ: อัญเชิญเทพ ReGex เขียน .htaccess Rewrite ให้ด้วยเทอญ
เริ่มหัวข้อโดย: Fallen ที่ 21 สิงหาคม 2018, 21:30:24
ลิ๊งจาก googleที่ indexไว้ รูปแบบจะเป็นแบบนี้
http://xxx.com/forum/index.php/topic,2697

แต่ script ผม เวลากดลิ๊งจะเป็นแแบบนี้
http://www.xxx.com/forum/single.php?id=2697

อยากให้รีไร๊ทเป็นแบบนี้ (เหมือนที่มาจากลิ๊งของ google)
http://xxx.com/forum/index.php/topic,2697
http://xxx.com/forum/index.php?topic=2697
http://xxx.com/forum/index.php/topic,2697.0
http://xxx.com/forum/index.php?topic=2697.0

คือ ได้ทั้ง4 แบบอ่ะ
ตามหลักจะทำได้ไหมครับ

edit เพิ่มนะ


 :wanwan017:  :wanwan017:  :wanwan017:


หัวข้อ: Re: อัญเชิญเทพ ReGex เขียน .htaccess Rewrite ให้ด้วยเทอญ
เริ่มหัวข้อโดย: mean ที่ 21 สิงหาคม 2018, 21:38:00
RewriteEngine on
RewriteRule ^/?forum/index.php/topic,([0-9]+)$ /forum/single.php?id=$1

ไม่ได้ทดสอบนะครับ

ส่วน URL Format ต้องแปลงเอาให้ได้รูปแบบที่ต้องการครับ


หัวข้อ: Re: อัญเชิญเทพ ReGex เขียน .htaccess Rewrite ให้ด้วยเทอญ
เริ่มหัวข้อโดย: Fallen ที่ 22 สิงหาคม 2018, 07:28:41
RewriteEngine on
RewriteRule ^/?forum/index.php/topic,([0-9]+)$ /forum/single.php?id=$1

ไม่ได้ทดสอบนะครับ

ส่วน URL Format ต้องแปลงเอาให้ได้รูปแบบที่ต้องการครับ


 :wanwan017: +1


หัวข้อ: Re: อัญเชิญเทพ ReGex เขียน .htaccess Rewrite ให้ด้วยเทอญ
เริ่มหัวข้อโดย: Fallen ที่ 22 สิงหาคม 2018, 07:30:08
ทำยังไง จะได้ เครื่องหมาย ? และ =

 :P


หัวข้อ: Re: อัญเชิญเทพ ReGex เขียน .htaccess Rewrite ให้ด้วยเทอญ
เริ่มหัวข้อโดย: jewyi ที่ 22 สิงหาคม 2018, 09:19:17
รอท่านเทพ  :'(


หัวข้อ: Re: อัญเชิญเทพ ReGex เขียน .htaccess Rewrite ให้ด้วยเทอญ
เริ่มหัวข้อโดย: yaplay ที่ 31 สิงหาคม 2018, 00:40:27
ตามผู้รู้มีแต่ได้ :P


หัวข้อ: Re: อัญเชิญเทพ ReGex เขียน .htaccess Rewrite ให้ด้วยเทอญ
เริ่มหัวข้อโดย: infamous ที่ 31 สิงหาคม 2018, 11:16:51
ไม่ใช่เทพนะครับ แต่อยากช่วยครับ

โค๊ด:
RewriteEngine on
RewriteRule ^topic,([0-9\.]+)$ /forum/single.php?id=$1 [QSA,L]
RewriteRule ^topic=([0-9\.]+)$ /forum/single.php?id=$1 [QSA,L]

ปล. ต้องเทพด้วยหรือครับ?