ถามเรื่อง mod rewrite หน่อยครับ

เริ่มโดย ahon, 21 ตุลาคม 2011, 17:40:18

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

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

ahon

อยากเปลี่ยนจาก

http://act.hotelandresortthailand.com/?p=593

เป็น

http://hotelandresortthailand.com/act.php?id=593

เขียน  RewriteRule ยังไงครับ งงมากๆ งมมานานแล้ว  เอาเฉพาะ id นี้..นะครับ   ขอบคุณครับ
[direct=http://hotelandresortthailand.com]█ โปรโมชั่นโรงแรม By Hotel&Resort █[/direct]
[direct=http://hotelandresortthailand.com/search.php?destination=73]█ รีวิวโรงแรมเชียงใหม่ By Hotel&Resort█[/direct]  จะไปเที่ยวเชียงใหม่ ดูก่อนนะครับ

ahon

[direct=http://hotelandresortthailand.com]█ โปรโมชั่นโรงแรม By Hotel&Resort █[/direct]
[direct=http://hotelandresortthailand.com/search.php?destination=73]█ รีวิวโรงแรมเชียงใหม่ By Hotel&Resort█[/direct]  จะไปเที่ยวเชียงใหม่ ดูก่อนนะครับ

ohmohm

ไม่ได้ทดสอบล่ะครับ แต่น่าจะประมาณนี้ ถ้าเพื่อแค่ 593

RewriteCond %{REMOTE_HOST} ^act\.hotelandresortthailand\.com$
RewriteCond %{REQUEST_URI} ^/$
RewriteCond %{QUERY_STRING} ^p\=593$
RewriteRule ^/$ hotelandresortthailand.com/act.php?id=593

ahon

#3
อ้างถึงจาก: ohmohm ใน 21 ตุลาคม 2011, 22:43:44
ไม่ได้ทดสอบล่ะครับ แต่น่าจะประมาณนี้ ถ้าเพื่อแค่ 593

RewriteCond %{REMOTE_HOST} ^act\.hotelandresortthailand\.com$
RewriteCond %{REQUEST_URI} ^/$
RewriteCond %{QUERY_STRING} ^p\=593$
RewriteRule ^/$ hotelandresortthailand.com/act.php?id=593


ขอบคุณ ครับ  .. ลองแล้วไม่ทำงานครับ   คิดว่าเกี๋ยวกับ  ? ครับ

[direct=http://hotelandresortthailand.com]█ โปรโมชั่นโรงแรม By Hotel&Resort █[/direct]
[direct=http://hotelandresortthailand.com/search.php?destination=73]█ รีวิวโรงแรมเชียงใหม่ By Hotel&Resort█[/direct]  จะไปเที่ยวเชียงใหม่ ดูก่อนนะครับ

ahon

#4
ทำได้แล้ว ครับ  :wanwan019:

= ไม่ต้อง เอสเขปครับ

ขอบคุณมากๆ
[direct=http://hotelandresortthailand.com]█ โปรโมชั่นโรงแรม By Hotel&Resort █[/direct]
[direct=http://hotelandresortthailand.com/search.php?destination=73]█ รีวิวโรงแรมเชียงใหม่ By Hotel&Resort█[/direct]  จะไปเที่ยวเชียงใหม่ ดูก่อนนะครับ