سؤال

أواجه مشكلة في الحصول على Codeigniter للعمل على حساب الاستضافة المشترك. عنوان URL هو http://test.tallgreentree.com.. وبعد لا يعطيني خطأ .php، ولكنه يعرض صفحة 404 لكل ما اكتبه في شريط العناوين.

ها هي بداية ملف CONFIG.PHP الخاص بي.

<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
|   http://example.com/
|
*/
$config['base_url'] = "http://test.tallgreentree.com/";

/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = "index.php";

/*
|--------------------------------------------------------------------------
| 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'] = "AUTO";

هل هناك مشكلات معروفة عند استخدام Codeigniter مع المجال الفرعي؟ ما يمكن أن يسبب هذا؟ لقد جربت تكوينات متعددة، لكن لا شيء يبدو أنه يعمل بالنسبة لي. ما هي إعدادات الخادم التي يجب أن أتحقق منها مع مزود الاستضافة الخاص بي؟

شكرا لكم جميعا على وقتك والمساعدات.

هل كانت مفيدة؟

المحلول

يتغيرون

$config['uri_protocol'] = "AUTO";

ل

$config['uri_protocol'] = "REQUEST_URI"

ومعرفة ما إذا كان هذا يعمل عليه

أيضا، هل لديك اسم وحدة تحكم الفصل نفس اسم الملف؟

اسم الملف = test.php.

class Test ...

نصائح أخرى

إجراء 2 التغييرات في ملف config.php

الأول هو:

   `$config['uri_protocol'] = "AUTO";`

ل

   `$config['uri_protocol'] = "REQUEST_URI"`

الثاني هو:

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

ل

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

حصلت على هذا العمل مع "request_uri" ولكن بعد ذلك يمكنني فقط ضرب صفحتي الرئيسية. يتم تحديث جميع الروابط الأخرى (إلى وحدة التحكم) دائما إلى الصفحة الرئيسية. إنه نوع من الغريب أنه يظهر عنوان URL الصحيح ولكنه يأخذك إلى الصفحة الرئيسية بغض النظر عن عنوان URL الذي تنقر عليه.

أيه أفكار؟ لدي ملف .htaccess،

rewriteEngine على rewriteBase / testci rewritecond٪ {price_uri} ^ ^. * إعادة التباين ^ (.) $ /index.php/$1 [l] rewritecond٪ {replay_filename}!) index $ index.php / $ 1 [l] rewriteCond $ 1! ^ (index.php | الصور | CAPTCHA | CSS | JS | Robots.txt) AddType Text / CSS .css

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top