ผมทำ wordpress multisite sub domain โดยใช้คำสั่ง
ServerAlias *.|DOMAIN|
เปิดให้ลูกค้าที่ทำเว็บใช้งานผ่าน Multisite เช่น asia.testdomain.com
แต่ผมต้องการ Sub domain ชื่อว่า demo.domain.com ผมใช้คำสั่ง
|*if demo|
ServerAlias |demo|.testdomain.com
|*endif|
มันถูกต้องหรือเปล่าครับ ทั้งหมดที่ใส่ไว้ใน [FONT=verdana]Httpd.conf Customization[/FONT][COLOR=#EEEEEE][FONT=verdana]
[/FONT][/COLOR]
ServerAlias *.|DOMAIN|
|*if demo|
ServerAlias |demo|.testdomain.com
|*endif|
[COLOR=#EEEEEE][FONT=verdana]
[/FONT][/COLOR]
[COLOR=#EEEEEE][FONT=verdana]
[/FONT][/COLOR]
rtsp
2
ไม่ชัวร์ว่าใส่เงื่อนไขแบบนี้แล้วจะพังป่าว (บรรทัดเดียวกัน) ผมมั่วสดเอาอะ คุณลองดูละกัน
ServerAlias *.|DOMAIN| |*if demo| demo.|DOMAIN| |*endif|
แต่ถ้าแบบนี้ได้ชัวร์ครับ
ServerAlias *.|DOMAIN| demo.|DOMAIN|
เดี๋ยวนะ? *. มันก็คลุมทุก subdomain อยุ่แล้วนะครับ จะแอดเดโม่เพิ่มยังไงอะ ผมชักงงละ -o-’
ayejung
3
ServerAlias *.|DOMAIN| ----- ถูก
[COLOR=#ff0000]
|*if demo| ServerAlias |demo|.testdomain.com |*endif|
สีแดงผิด
[/COLOR]ถ้าจะสร้าง subdomain ใช้ต่างหาก ก็ไปสร้างตรง Subdomain Management เลยครับ
ผมทำเป็น Multisite SubDomain ผมลอง Add Subdomain Management แล้วมันไม่ได้อ่ะครับ เพราะผมใช้คำสั่ง [COLOR=#333333]ServerAlias *.|DOMAIN| อยู่อ่ะครับ
ตัวอย่าง demo.phranakornsoft.com // ผมจะเอาไว้ Show Themes หรือ DEMO งานอื่นๆ
[/COLOR]
ผมไปหาคู่มือ เจอที่ http://help.directadmin.com/item.php?id=127 แต่ไม่เข้าใจเลยครับ
[COLOR=#000000][FONT=courier new]|*if SUB|[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] ServerAlias |SUB|.domain2.com[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]|*endif|
[/FONT][/COLOR]
kke
6
|demo| ตัวแปรชื่อ demo ไม่มีครับ da มันใช้ชื่อตัวแปร |SUB| ครับ
ส่วนเงื่อนไข |*if SUB| หมายความว่ามีการกำหนดตัวแปร SUB มา ก็ทำตามเงื่อนไข
จะมาใช้ |*if demo| กับ |demo| มันก็ไม่ได้แน่ครับเพราะ da ไม่ได้มีตัวแปรชื่อ demo มีแต่ตัวแปร SUB
ลองแบบนี้ไม่รู้ได้เปล่า
|*if SUB=demo|[COLOR=#000000][FONT=courier new]
ServerAlias |SUB|.|DOMAIN|[/FONT][/COLOR]
documentroot /home/…
[COLOR=#000000][FONT=courier new]|*endif|[/FONT][/COLOR]
ที่สำคัญน่าจะเป็นเรื่องของ documentroot ครับ กำหนดไปคนละที่กับโดเมนหลัก เพราะถ้าจะไปที่เดียวกันก็ไม่มีเหตุผลที่จะต้องไปแก้ไข
ตามมาอัพเดทข้อมูลครับ ยังไม่ทำงานไม่ได้กับคำสั่ง [COLOR=#333333]|*if SUB=demo| นะครับ ผมใช้วิธีแก้ไขไปใช้เป็น Sub Directory แทนครับ แต่ก็ยังอยากได้เป็น Sub Domain อยู่ครับ
มันคงมีปัญหากับตัว WordPress เองด้วยครับ[/COLOR]