[codeigniter] remove index.php ใน url มีปัญหา

เริ่มโดย 20auguzt, 28 เมษายน 2011, 10:01:56

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

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

20auguzt

คือลองเทสในเครื่องตัวเองใช้ได้ แต่อัพขึ้น hostgator แล้วมันมีปัญหาครับ คือไม่ว่าพิมพ์ url ไปที่หน้าไหน มันจะ forward มาที่ default controller ตลอดเลยครับ เช่น

http://sub.xxx.com/admin => โชว์หน้า default controller ที่เราตั้งไว้ อันนี้มันเป็นทุกหน้านะครับไม่ใช่เป็นที่หน้านี้หน้าเดียว
http://sub.xxx.com/index.php/admin => โชว์หน้า admin ถูกต้อง


ผมงงอยู่ว่าเป็นที่อะไร ไฟล์ที่ผมแก้ก็มี

config.php
$config['index_page'] = '';

.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond $1 !^(index\.php|images|css|assets|robots\.txt)
</IfModule>

แล้วก็เข้าไปแก้ include_path ใน php.ini ของ hostgator อันนี้ไม่รู้เกี่ยวมั้ย

ไม่รู้ผมพลาดตรงไหนเพื่อนๆ ช่วยชี้ทางให้ผมด้วยฮะ

[direct=http://www.sofinebykiss.com]เสื้อผ้าแฟชั่น[/direct]
[direct=http://www.sofinebykiss.com]เครื่องสำอางค์เกาหลี[/direct]

20auguzt

แก้ได้แล้วครับขอบคุณครับ
[direct=http://www.sofinebykiss.com]เสื้อผ้าแฟชั่น[/direct]
[direct=http://www.sofinebykiss.com]เครื่องสำอางค์เกาหลี[/direct]

bouy22

สนใจทำธุรกิจ[direct=http://www.nongphojsin.com/]ไอศกรีมหนองโพ[/direct]คลิกเลย | ลงประกาศโฆษณา [direct=http://www.marukopost.com/]ประกาศฟรี[/direct] | [direct=http://www.uuppic.com/]เว็บฝากรูป[/direct] | [direct=http://www.jeedgame.com/]สคริปเกมแฟลช[/direct] |
ผลิตภัณฑ์เสริมอาหารออกซิเจนน้ำ [direct=http://www.adoxy-thai.com/]Adoxy[/direct]

Joejoe

ก็รีบศึกษาเข้านะครับ ยิ่งตอนนี้ version 2 เพิ่งออกมาไม่นาน ถ้าจะศึกษาแนะนำ 2.x ขึ้นนะครับ เพราะ กฎการใช้งานบางข้อของ ci เปลี่ยนแปลงนิดหน่อย

penthai06

#4
/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string.  The default setting of "AUTO" works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'AUTO'         Default - auto detects
| 'PATH_INFO'      Uses the PATH_INFO
| 'QUERY_STRING'   Uses the QUERY_STRING
| 'REQUEST_URI'      Uses the REQUEST_URI
| 'ORIG_PATH_INFO'   Uses the ORIG_PATH_INFO
|
*/
$config['uri_protocol']   = "PATH_INFO";

บางทีมันก็เกี่ยวกับตรงนี้ด้วยนะ บางโฮสก็ใช้ ORIG_PATH_INFO ครับบางโฮสก็ใช้ QUERY_STRING
[direct=http://www.compilewedding.com]Wedding Directory, Bridal, Compilewedding.com[/direct]
[direct=http://www.traveldirectlink.com]Travel Directory, Traveldirectlink.com[/direct]