CodeIgniter Forums
URL Problem - IIS Support - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: URL Problem - IIS Support (/showthread.php?tid=58260)

URL Problem - IIS Support - El Forum - 05-28-2013

Hello ,

I am running codeignitor on a shared windows hosting , which uses IIS to provide PHP support.
Now , when i am trying to render my project using it works ! but if I try to use something like I am getting a 404 error . I tried to change the the following
$config['uri_protocol'] = 'QUERY_STRING';

Now , using the following when I navigate to it starts rendering but it starts error about
<!doctype html>
which is really strange.

I have configured a web.config as follows

&lt;?xml version="1.0" encoding="UTF-8"?&gt;


        <httpErrors errorMode="Detailed" />
        <asp scriptErrorSentToBrowser="true"/>

            <rule name="RuleRemoveIndex" stopProcessing="true">
                <match url="^(.*)$" ignoreCase="false" />
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                <action type="Rewrite" url="index.php/{R:1}" appendQueryString="true"/>


        <customErrors mode="Off"/>
        <compilation debug="true"/>

My Controller

class Pages extends CI_Controller {

    public function index() {

    public function view($page = 'home') {
        if (!file_exists('application/views/pages/' . $page . '.php')) {
            // Whoops, we don't have a page for that!
        $data['title'] = ucfirst($page); // Capitalize the first letter
        $data['company_name'] = "Demo Company 2013";
        $this->load->view('templates/header', $data);
        $this->load->view('pages/' . $page, $data);
        $this->load->view('templates/footer', $data);


My Route

$route['default_controller'] = 'pages';
$route['(:any)'] = 'pages/view/$1'; $route['404_override'] = '';


$config['index_page'] = '';
$config['base_url'] = '';

URL Problem - IIS Support - El Forum - 05-28-2013

What do you mean by:
Quote:but it starts error about
<!doctype html>

Also, I would recommend you try to find a Linux-based Web host, unless you have some compelling reason to pick a Windows server. As far as I'm aware, it's normally cheaper for starters.

URL Problem - IIS Support - El Forum - 05-28-2013

I finally , figured it out. Thanks a lot for the reply. The problem was I wasn't using base_url while adding my resources. Everything is work as expected. Thanks