การเขียน .htaccess

เริ่มโดย Pinwanit, 02 พฤษภาคม 2013, 10:00:33

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

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

Pinwanit

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

http://www.xxx.com/index.php?Str=1 ต้องการให้แสดงเป็น http://www.xxx.com/index/Str/1

RewriteEngine On
RewriteRule ^Str/([^/]*)\.html$ /index.php?Str=$1 [L]

ทำยังไงก็ไม่เปลี่ยน งงมาก ครับ :wanwan017: :wanwan017: :wanwan017:
รับทำเพจ รับทำเว็บไซต์ ดูแลเพจ โปรโมทเพจ
Line@ : https://line.me/R/ti/p/%40ztl9090a

xvlnw.com

RewriteRule ^index/Str/([^/]*)$ /index.php?Str=$1 [L]
[direct=https://cloudhost.in.th/wordpress-hosting]ツ ⓌⓄⓇⒹⓅⓇⒺⓈⓈ ⒽⓄⓈⓉⒾⓃⒼ [/direct] :wanwan014:  :D
[direct=https://cloudhost.in.th/cloudhosting.html]Cloud Hosting[/direct] [direct=https://cloudhost.in.th/cloudvps.html]Cloud Server[/direct] [direct=https://cloudhost.in.th/vpshosting.html]Cloud VPS Hosting[/direct] [direct=https://cloudhost.in.th/windowsvps.html]Cloud Windows[/direct] Tel: 080-348-0843 LINE: ixvlnw

mikeyx

พารามิเตอร์ที่เป็นตัวเลขใช้ ([0-9]+) ดีกว่าครับ
^index/Str/([0-9]+)$ /index.php?Str=$1 [L]

xvlnw.com

อ้างถึงจาก: mikeyx ใน 02 พฤษภาคม 2013, 10:12:52
พารามิเตอร์ที่เป็นตัวเลขใช้ ([0-9]+) ดีกว่าครับ
^index/Str/([0-9]+)$ /index.php?Str=$1 [L]

อะลืมไปครับ.. แนะนำตามนี้ครับ
[direct=https://cloudhost.in.th/wordpress-hosting]ツ ⓌⓄⓇⒹⓅⓇⒺⓈⓈ ⒽⓄⓈⓉⒾⓃⒼ [/direct] :wanwan014:  :D
[direct=https://cloudhost.in.th/cloudhosting.html]Cloud Hosting[/direct] [direct=https://cloudhost.in.th/cloudvps.html]Cloud Server[/direct] [direct=https://cloudhost.in.th/vpshosting.html]Cloud VPS Hosting[/direct] [direct=https://cloudhost.in.th/windowsvps.html]Cloud Windows[/direct] Tel: 080-348-0843 LINE: ixvlnw

Pinwanit

ลองแล้วครับ แต่ก็ยังไม่ได้อยู่ดี เฮ้อ
รับทำเพจ รับทำเว็บไซต์ ดูแลเพจ โปรโมทเพจ
Line@ : https://line.me/R/ti/p/%40ztl9090a

scissoring

อ้างถึงจาก: Pinwanit ใน 02 พฤษภาคม 2013, 10:00:33
ผมพยายามเขียนแล้วแต่มันก็ไม่เปลี่ยนให้ ทุกอย่างเปิดหมดแล้ว รบกวนผู้รู้แนะนำหน่อยครับเช่น

http://www.xxx.com/index.php?Str=1 ต้องการให้แสดงเป็น http://www.xxx.com/index/Str/1

RewriteEngine On
RewriteRule ^Str/([^/]*)\.html$ /index.php?Str=$1 [L]

ทำยังไงก็ไม่เปลี่ยน งงมาก ครับ :wanwan017: :wanwan017: :wanwan017:


ตัวอย่างเว็บ...  :wanwan004:

xvlnw.com

อ้างถึงจาก: Pinwanit ใน 02 พฤษภาคม 2013, 10:40:52
ลองแล้วครับ แต่ก็ยังไม่ได้อยู่ดี เฮ้อ

ถ้าไม่ได้จริงๆ
ผมแนะนำให้ทำตามนี้ครับ

http://xvlnw.com/htaccess

มาจับเอาที่ PHP Script เลยครับ
เหมือนอย่างที่ CMS หลายๆตัวทำ เช่น Wordpress เป็นต้นครับ
ไม่ต้องปวดกะบานกับ .htaccess ครับ
:wanwan003:
[direct=https://cloudhost.in.th/wordpress-hosting]ツ ⓌⓄⓇⒹⓅⓇⒺⓈⓈ ⒽⓄⓈⓉⒾⓃⒼ [/direct] :wanwan014:  :D
[direct=https://cloudhost.in.th/cloudhosting.html]Cloud Hosting[/direct] [direct=https://cloudhost.in.th/cloudvps.html]Cloud Server[/direct] [direct=https://cloudhost.in.th/vpshosting.html]Cloud VPS Hosting[/direct] [direct=https://cloudhost.in.th/windowsvps.html]Cloud Windows[/direct] Tel: 080-348-0843 LINE: ixvlnw