ไฟล์ .htaccess มีปัญหาเรื่องไฟล์ index.php เป็น index.html

เริ่มโดย yuckyai, 09 ธันวาคม 2010, 00:45:03

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

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

yuckyai

คือตอนนี้ผมใช้แบบนี้อยู่น่ะครับไฟล์ shop.php ใช้ได้ปรกติ ไฟล์หลักเป็น index.php

Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L]
RewriteRule ^([a-z]*).html shop.php?name=$1 [L]


ผมอยากให้ไฟล์ index.php เป็น index.html ก็เลยเพิ่มบรรทัดนี้มา

RewriteRule ^index.html$ index.php [L]

แต่ปรากฏว่ามันใช้ไม่ได้เพราะดูเหมือนว่ามันจะไปติดตรงบรรทัดนี้

RewriteRule ^([a-z]*).html shop.php?name=$1 [L]

มันไม่ยอมให้คลิ๊กผ่านลิงค์เช่น mydomain.com/index.html มันจะเรียกหน้าวนอยู่อย่างนั้นตลอด ไม่ทราบว่าพอมีทางแก้ไหมครับ  :P


- ต้องลองถึงรู้ -

rapephatra

ลองดูครับ

# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

:wanwan016:
ขาย domain HOSTS.IN.TH สนใจ PM ราคาได้ครับ

Impossible is Nothing, Perfect is Impossible, Failure is Unacceptable !

Tee++;

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9]+)\.html shop.php?name=$1 [L]
[direct=http://laravel.in.th]Laravel in Thai[/direct]
[direct=http://jquerytips.com]jQueryTips by Tee++;[/direct]
[direct=https://www.facebook.com/jQueryTips]jQueryTips Page[/direct]
[direct=https://www.facebook.com/Laravel.in.th]Laravel in Thai Page[/direct]
[direct=https://twitter.com/Teepluss]Teepluss's Twitter[/direct]