Welcome Guest, Not a member yet? Register   Sign In
URL Problem - IIS Support

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 www.mysite.com/myfolder it works ! but if I try to use something like www.mysite.com/myfolder/my_controller/my_function 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 www.mysite.com/myfolder/my_controller/my_function 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'] = '';

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.

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

Theme © iAndrew 2016 - Forum software by © MyBB