ThaiSEOBoard.com

พัฒนาเว็บไซต์ => Programming => ข้อความที่เริ่มโดย: 20auguzt ที่ 28 เมษายน 2011, 10:01:56



หัวข้อ: [codeigniter] remove index.php ใน url มีปัญหา
เริ่มหัวข้อโดย: 20auguzt ที่ 28 เมษายน 2011, 10:01:56
คือลองเทสในเครื่องตัวเองใช้ได้ แต่อัพขึ้น 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 อันนี้ไม่รู้เกี่ยวมั้ย

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



หัวข้อ: Re: [codeigniter] remove index.php ใน url มีปัญหา
เริ่มหัวข้อโดย: 20auguzt ที่ 28 เมษายน 2011, 13:45:03
แก้ได้แล้วครับขอบคุณครับ


หัวข้อ: Re: [codeigniter] remove index.php ใน url มีปัญหา
เริ่มหัวข้อโดย: bouy22 ที่ 28 เมษายน 2011, 13:46:34
อยากศึกษา codeigniter บางจัง :-[


หัวข้อ: Re: [codeigniter] remove index.php ใน url มีปัญหา
เริ่มหัวข้อโดย: Joejoe ที่ 28 เมษายน 2011, 17:32:31
ก็รีบศึกษาเข้านะครับ ยิ่งตอนนี้ version 2 เพิ่งออกมาไม่นาน ถ้าจะศึกษาแนะนำ 2.x ขึ้นนะครับ เพราะ กฎการใช้งานบางข้อของ ci เปลี่ยนแปลงนิดหน่อย


หัวข้อ: Re: [codeigniter] remove index.php ใน url มีปัญหา
เริ่มหัวข้อโดย: penthai06 ที่ 28 เมษายน 2011, 17:47:53
/*
|--------------------------------------------------------------------------
| 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