ThaiSEOBoard.com

Host and Domain => Host & Domain (general) => ข้อความที่เริ่มโดย: desiger ที่ 16 กันยายน 2007, 14:39:01



หัวข้อ: ช่วยด้วยครับ .htaccess ทำไมมันเป็นอย่างนี้
เริ่มหัวข้อโดย: desiger ที่ 16 กันยายน 2007, 14:39:01
คือว่าผมใช้ freehostia อ่ะครับ ไม่เข้าใจเหมือนกันว่า ทำไมบางทีใช้ .htaccess ได้มั่ง ไม่ได้มั่ง

ปัญหาที่เป็นตอนนี้

คือเว็บผมมี โดเมน หลักแค่ directory.com & directoryou.com/blog อ่ะครับ

directoryou.com ใช้ phpld 3.2.0(ในห้อง tool ที่แจกกัน) แล้วใช้ไฟล .htaccess เวลาเปิดหน้าเว็บ มานจาได้อย่างงี้อ่ะครับ แล้วก้เป็นหมดเลยอ่ะครับ ไม่ว่าจะเป็น โดเมนเมนไหน
(http://img.icez.net/i/10/7sps1.png)


แต่พอ กำหนดให้ .htaccess ของ phpld (directoryou.com) ให้เปงชื่อ aaa.htaccess(ไม่ใช้งานนั่นเอง)
แล้ว directoryou.com/blog ใช้ wordpress แล้วใช้ .htaccess เหมือนกัน แต่เวลาเปิดหน้าเว็บกลับเปิดได้อ่ะครับ แล้วก้ใช้ไฟล์ .htaccess ได้ด้วย
(http://img.icez.net/i/lr/wtjj2.png)

ผมงงมากเลยอ่ะครับ ไม่รู้ว่าจะแก้อย่างไงอ่ะครับ

ส่วนนี่เป็นโค้ด .htaccess ของ wordpress
โค๊ด:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>

# END WordPress

อันนี้เป็นโค้ด .htaccess ของ phpld
โค๊ด:
#################################################
## PHP Link Directory - Apache Server Settings ##
#################################################

# Prevent .htaccess and .htpasswd files from being viewed by web clients
<Files "^\.ht">
    Order allow,deny
    Deny from all
</Files>

# Protect files
<Files ~ "^(.*)\.(inc|inc\.php|tpl|sql)$">
  Order deny,allow
  Deny from all
</Files>

# Protect directories
<Files ~ "^(backup|files|images|include|lang|libs(/.+)?|temp(/.+)?|templates(/.+)?|javascripts(/.+)?)$">
  Order deny,allow
  Deny from all
</Files>

# Disable directory browsing
Options -Indexes

# Follow symbolic links in this directory
Options +FollowSymLinks

# Override PHP settings that cannot be changed at runtime
# (If your server supports PHP settings via htaccess you can comment following two lines off)
# php_value register_globals   0
# php_value session.auto_start 0

# Customized error messages
# ( If you are running in a subfolder please add it, example: "directory/index.php?httpstatus=404" )
ErrorDocument 404 index.php?httpstatus=404

# Set the default handler
DirectoryIndex index.php

# URL rewrite rules
<IfModule mod_rewrite.c>
   RewriteEngine On


   #Make sure RewriteBase points to the directory where you installed phpLD.
   #Example: "/phpld" if your installation is in a "phpld" subdirectory.

   #RewriteBase /

   ##Latest Links Rewrite
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule ^latest-links\.htm[l]?$ index.php?list=latest [QSA,NC,L]

   ##Top Hits Rewrite
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule ^top-hits\.htm[l]?$ index.php?list=top [QSA,NC,L]

   ##Latest Articles Rewrite
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule ^latest-articles\.htm[l]?$ index.php?list=latestarticles [QSA,NC,L]

   ##Details Link Page Rewrite
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule (.*)detail/link-(.*)\.htm[l]?$ detail.php [QSA,NC]

   ##Article Page Rewrite
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule (.*)articles/article-(.*)\.htm[l]?$ article.php [QSA,NC]

   ##Pagination Rewrite
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule (.*)page-(\d+)\.htm[l]?(.*)$  $1/?p=$2 [PT,NC]

   ##Category redirect
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>

ไม่ทราบว่า มีวิธีแก้ไหมครับ เพราะผมเคยลองกับ saiyaithai.org ก้เป็นเหมือนกัน
แล้วก็เคยลง แบบ directoryou.com โดยใช้ wordpress ก้ใช้ .htaccess ก็ไม่มีปัญหาอะไรอ่ะครับ

ไม่ทราบแก้อย่างไงครับ รบกวนด้วยครับ   :P


หัวข้อ: Re: ช่วยด้วยครับ .htaccess ทำไมมันเป็นอย่างนี้
เริ่มหัวข้อโดย: ก้ามปู ที่ 16 กันยายน 2007, 14:45:28
โฮสไม่รองรับครับ

ลองไปแก้ที่คอนโทรพาเนล

ปัญหานี้จะเกิดท ี่เนต firm เป็นต้น


หัวข้อ: Re: ช่วยด้วยครับ .htaccess ทำไมมันเป็นอย่างนี้
เริ่มหัวข้อโดย: desiger ที่ 16 กันยายน 2007, 14:48:07
โฮสไม่รองรับครับ

ลองไปแก้ที่คอนโทรพาเนล

ปัญหานี้จะเกิดท ี่เนต firm เป็นต้น

แก้ที่ cp อย่างไงอ่ะครับ

คือว่า domain.com มานใช้ .htaccess ไม่ได้ แต่ domain.com/blog กลับใช้ได้อ่ะครับ

งง ตรงนี้เหมือนกันอ่ะครับ

หรือว่าเป็นเฉพาะ wordpress ที่ทำให้ .htaccess ใช้ได้ครับ


หัวข้อ: Re: ช่วยด้วยครับ .htaccess ทำไมมันเป็นอย่างนี้
เริ่มหัวข้อโดย: ก้ามปู ที่ 16 กันยายน 2007, 14:50:56
อ่าาา ใช้โฮสที่ไหนอ่ะครับ
มันแปล่งๆ

แล้วรายละเอียดคือ phpld นี่เวอชั่นไหนคับ

ถ้าเป็นโฮสเนตเฟิรม ก็เข้าไปแก้ที่คอนโทร ตรงแก้โมดูลอ่ะคับ ของโฮสนะ
ตรงโมดูลที่ชื่อว่า rewrite url


หัวข้อ: Re: ช่วยด้วยครับ .htaccess ทำไมมันเป็นอย่างนี้
เริ่มหัวข้อโดย: desiger ที่ 16 กันยายน 2007, 14:52:46
ใช้ freehostia ครับ
phpld 3.2.0



หัวข้อ: Re: ช่วยด้วยครับ .htaccess ทำไมมันเป็นอย่างนี้
เริ่มหัวข้อโดย: cpcmaker ที่ 16 กันยายน 2007, 15:19:43
เป็นที่โฮสต์น่ะครับ


หัวข้อ: Re: ช่วยด้วยครับ .htaccess ทำไมมันเป็นอย่างนี้
เริ่มหัวข้อโดย: หมาเน่า ที่ 16 กันยายน 2007, 17:51:05
โฮสตไม่อนุญาตให้อัพ แต่พออัพเฃ่นแฃ้วจะเน่าเลย ผมเคยลองที่ saiyaithai เป็นแบบนี้เลยครับ  :P


หัวข้อ: Re: ช่วยด้วยครับ .htaccess ทำไมมันเป็นอย่างนี้
เริ่มหัวข้อโดย: desiger ที่ 22 กันยายน 2007, 18:30:07
ขอขุดหน่อยนะครับ

ผมลองที่ root directory ก้ใช้ได้น่ะครับ เช่น url
โค๊ด:
hxxp://subdomain.freehost.com/

มานก้ยังใช้การ mod rewrite ของ wp ได้นะครับ แต่ใช้ .htaccess ของ phpld ไม่ได้อยู่ดี

ไม่รู้ว่าเป็นที่ไฟล์ .htaccess หรือเปล่า

เรื่องการอัพโหลดยังใช้ได้น่ะครับ คืออัพขึ้นไปได้ .htaccess [phpld] ใช้ไม่ได้ แต่ .htaccess [wordpress] กลับใช้ได้อ่ะครับ

ไม่รู้ว่าต้องแก้อย่างไงดีครับ

 :P


หัวข้อ: Re: ช่วยด้วยครับ .htaccess ทำไมมันเป็นอย่างนี้
เริ่มหัวข้อโดย: ball6847 ที่ 22 กันยายน 2007, 19:33:41
Free Host เป็นเงี้ยะอ่ะคับ ทีแรกผมก็ชอบนะ Free Hostia หลังๆรู้สึกจะล่มบ่อย สั่ง webcron ยิงทุก ชม. แต่ยิงแล้วเจอ HTTP/200 เนี่ย ไม่ถึง 2 ทีเอง บางวัน ยิงไม่ติดทั้งวัน

แต่กะ .htaccess ผมไม่แน่ใจนะคับ ผมว่าลองเปลี่ยน Host ดีมะคับ


หัวข้อ: Re: ช่วยด้วยครับ .htaccess ทำไมมันเป็นอย่างนี้
เริ่มหัวข้อโดย: desiger ที่ 22 กันยายน 2007, 20:26:33
คืออยากได้โฮสฟรีที่ ลง .htaccess ได้น่ะครับ เอาไว้ทำ directory แบบฟรีๆ

หาโฮสถูกมั่กๆ ม่ะได้อ่ะครับต่ำสุดที่เจอ 1$/m อยากได้ถูกก่านี้อ่ะครับ เอาไว้ลง phpld อย่างเดยวน่ะครับ

อ้างถึง
webcron ยิงทุก ชม.


webcorn คืออารายอ่ะครับ ม่ะรู้จัก - -a

ถ้าเจอฟรีไหนลง phpld ไม่มีปัญหาก้ช่วยบอกทีนะครับ

ขอบคุงครับ


หัวข้อ: Re: ช่วยด้วยครับ .htaccess ทำไมมันเป็นอย่างนี้
เริ่มหัวข้อโดย: icez ที่ 22 กันยายน 2007, 20:39:12
ลองแก้ตามที่สง่ให้ใน pm แล้วยังครับ


หัวข้อ: Re: ช่วยด้วยครับ .htaccess ทำไมมันเป็นอย่างนี้
เริ่มหัวข้อโดย: ball6847 ที่ 22 กันยายน 2007, 20:40:56
อ้างถึง
webcron ยิงทุก ชม.


webcorn คืออารายอ่ะครับ ม่ะรู้จัก - -a


คือถ้าใช้โฮสท์ฟรี มันจะไม่สามารถใช้ cronjob ได้อ่ะคับ (ถึงได้ผมก็ใช้ไม่เป็น) ผมก็เลยใช้บริการที่หนึ่งซึ่งเค้าบริการยิง cronjob ให้ฟรี ตามเวลาที่เราตั้งน่ะคับ

โค๊ด:
http://www.webcron.org

ผมตั้งให้ยิงไปที่ ไฟล์ php ที่ผมเขียนไว้ใน freehostia ทุกชม. แต่ยิงแล้ว response code มันไม่ใช่ HTTP/200 แสดงว่าโฮสท์มันล่มอยู่คับ เลยยิงไม่เจอ พอเช็คดู history ก็เจอว่ายิงติดกระปิดกระปรอย วันละที 2 ที พอลองเปลี่ยนโฮสท์ดู ปรากฎว่าติดทุก ชม.

แรกๆ ผมชอบเพราะ freehostia ใช้ allow_url_fopen ได้และก็ไม่มีโฆษณา แต่เรื่อง downtime นี่เครียดเลย(ไม่แน่ว่าอาจเป็นที่สคริปท์ผมมันกินทรัพยากรณ์เค้ามากไปมั้ง)

ออกนอกเรื่องไปไกลละ  :P


หัวข้อ: Re: ช่วยด้วยครับ .htaccess ทำไมมันเป็นอย่างนี้
เริ่มหัวข้อโดย: desiger ที่ 22 กันยายน 2007, 21:05:55
ลองแก้ตามที่สง่ให้ใน pm แล้วยังครับ

ok ครับ ได้แล้วครั ขอบคุงมากเรยครับ ^^

แต่มานต้องลบให้เลือกแค่
โค๊ด:
# URL rewrite rules
<IfModule mod_rewrite.c>
   RewriteEngine On


   #Make sure RewriteBase points to the directory where you installed phpLD.
   #Example: "/phpld" if your installation is in a "phpld" subdirectory.

   #RewriteBase /

   ##Latest Links Rewrite
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule ^latest-links\.htm[l]?$ index.php?list=latest [QSA,NC,L]

   ##Top Hits Rewrite
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule ^top-hits\.htm[l]?$ index.php?list=top [QSA,NC,L]

   ##Latest Articles Rewrite
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule ^latest-articles\.htm[l]?$ index.php?list=latestarticles [QSA,NC,L]

   ##Details Link Page Rewrite
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule (.*)detail/link-(.*)\.htm[l]?$ detail.php [QSA,NC]

   ##Article Page Rewrite
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule (.*)articles/article-(.*)\.htm[l]?$ article.php [QSA,NC]

   ##Pagination Rewrite
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule (.*)page-(\d+)\.htm[l]?(.*)$  $1/?p=$2 [PT,NC]

   ##Category redirect
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
ซึ่งฟังก์ชั่นก่อนหน้านั้น ไม่รู้เอาไว้ทำอาราย เดยวต้องลองๆ ทดสอบ -*- ถ้าเดาไม่ผิด สงสัยจา ไว้ป้องกัน directory อารายนี่ล่ะครับ

ตอนนี้กำลังทดสอบ อยู่ครับ ว่ามีปัญหาอารายรึเปล่า

ส่วนเรื่อง Cronjob ขอบคุงมากครับ ที่แนะเว็บยิงให้ ^^ แต่ก้เดยวลองเอาไปปรับๆดูครับ

ขอบคุงมากครับ

 :)