May 19, 2012, 06:16:33 PM

Author Topic: ทำ sub domain ไม่ได้ครับ  (Read 368 times)

0 Members and 1 Guest are viewing this topic.

Offline toucheva

  • Newbie
  • *
  • Posts: 7
  • ความคิดเห็น +0/-0
    • View Profile
ทำ sub domain ไม่ได้ครับ
« on: December 10, 2011, 12:41:32 AM »
ไม่รู้ตั้งยังไง ให้ sub domain ใช้ได้
ใช้ DirectAdmin
ติดตั้งเป็น sub domain เสร็จแล้ว พอกดลิงค์หรือ ปุ่มsearch จะกลับมาหน้าแรกของdomainหลัก
จากที่สังเกตุ sub domain ของผมต้องเป็นแบบนี้ http://projectorbulbs.bestsellerofblackfriday.com แต่พอกดเปลี่ยนหน้าแล้วมันกลับมาเป็นแแบบนี้ http://bestsellerofblackfriday.com/projectorbulbs


อันนี้ config.php
$install_path   = "projectorbulbs";

.htaccess
# BEGIN
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END

Offline Nicethai

  • Official Partner
  • Hero Member
  • *
  • Posts: 804
  • ความคิดเห็น +18/-0
    • View Profile
Re: ทำ sub domain ไม่ได้ครับ
« Reply #1 on: December 10, 2011, 08:14:32 AM »
ไม่รู้ตั้งยังไง ให้ sub domain ใช้ได้
ใช้ DirectAdmin
ติดตั้งเป็น sub domain เสร็จแล้ว พอกดลิงค์หรือ ปุ่มsearch จะกลับมาหน้าแรกของdomainหลัก
จากที่สังเกตุ sub domain ของผมต้องเป็นแบบนี้ http://projectorbulbs.bestsellerofblackfriday.com แต่พอกดเปลี่ยนหน้าแล้วมันกลับมาเป็นแแบบนี้ http://bestsellerofblackfriday.com/projectorbulbs


อันนี้ config.php
$install_path   = "projectorbulbs";

.htaccess
# BEGIN
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END

ที่ต้องแก้มีดังนี้ครับ...
ส่วนที่ 1 config.php
//001
//Please enter the name of folder you install this script
//leave blank quote "" if you install on root domain.
$install_path   = "";  // ไม่ต้องใส่ชื่อซับโดเมนครับ...ปล่อยว่าง (เราใส่เฉพาะกรณีทำซับโฟลเดอร์ครับ)

//002
//common configuration file
$domain         = "projectorbulbs.bestsellerofblackfriday.com";
$sitename   = "XXXXXXXXX";
$siteemail   = "XXXXXXXXX";
$authorname     = "XXXXXXXXX";

ส่วนที่ 2 .htaccess // ใส่ตามนี้ครับ
# BEGIN
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

# Redirect non-www to www // ตัวนี้จะทำให้ซับโดเมนแสดงผลทั้งมี www และไม่มี www ครับ
RewriteCond %{HTTP_HOST} ^projectorbulbs.bestsellerofblackfriday.com$
RewriteRule ^/?$ "http\:\/\/www\.projectorbulbs.bestsellerofblackfriday\.com" [R=301,L]

RewriteRule ^([^.]+)\.htm$ viewitem.php?iditem=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
# END

เป็นกำลังใจให้ครับ  O0

Offline toucheva

  • Newbie
  • *
  • Posts: 7
  • ความคิดเห็น +0/-0
    • View Profile
Re: ทำ sub domain ไม่ได้ครับ
« Reply #2 on: December 10, 2011, 03:54:06 PM »
ทำตามที่บอก ลิงค์ใช้ได้แล้วครับ ขอบคุณครับ
แต่ search แล้วกลับ Domain หลักเหมือนเดิมเลยครับ

Offline Nicethai

  • Official Partner
  • Hero Member
  • *
  • Posts: 804
  • ความคิดเห็น +18/-0
    • View Profile
Re: ทำ sub domain ไม่ได้ครับ
« Reply #3 on: December 10, 2011, 06:51:05 PM »
ทำตามที่บอก ลิงค์ใช้ได้แล้วครับ ขอบคุณครับ
แต่ search แล้วกลับ Domain หลักเหมือนเดิมเลยครับ

วิธีแก้ไขนะครับ
เข้าไปที่ /data/search.html
แก้ไขบรรทัดแรกของไฟล์ search.html ดังนี้...
<form action="http://projectorbulbs.bestsellerofblackfriday.com/processsearch/" method="post" name="search" class="mediumtext">

เป็นกำลังใจให้ครับ O0

Offline Nicethai

  • Official Partner
  • Hero Member
  • *
  • Posts: 804
  • ความคิดเห็น +18/-0
    • View Profile
Re: ทำ sub domain ไม่ได้ครับ
« Reply #4 on: December 10, 2011, 11:33:30 PM »
***อีกหนึ่งปัญหาที่ตรวจพบคือ ในหน้า contact us...เวลากด Submit จะส่ง Email ไปที่ Admin (คุณก้อง) ครับ***

วิธีแก้ไขนะครับ
เข้าไปที่ /data/contact-us.html
แก้ไขประมาณบรรทัดที่ 9 ของไฟล์ contact-us.html ดังนี้...
ของเดิม <form id="contact" name="contact" method="post" action="mailto:s_rungsalit@hotmail.com" enctype="text/plain" >
แก้เป็น <form id="contact" name="contact" method="post" action="mailto:ใส่ Email ของท่าน" enctype="text/plain" >

เป็นกำลังใจให้ครับ  O0

Offline toucheva

  • Newbie
  • *
  • Posts: 7
  • ความคิดเห็น +0/-0
    • View Profile
Re: ทำ sub domain ไม่ได้ครับ
« Reply #5 on: December 11, 2011, 11:48:53 AM »
ได้ละครับ ขอบคุณมากๆ