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

[eluser]Unknown[/eluser]
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
Code:
$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
Code:
<!doctype html>
which is really strange.

I have configured a web.config as follows

Code:
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
<configuration>

    <system.webServer>

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

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

    </system.webServer>

    <system.web>
        <customErrors mode="Off"/>
        <compilation debug="true"/>
    </system.web>

</configuration>
My Controller


Code:
class Pages extends CI_Controller {

    public function index() {
        $this->view("home");
    }

    public function view($page = 'home') {
        if (!file_exists('application/views/pages/' . $page . '.php')) {
            // Whoops, we don't have a page for that!
            show_404();
        }
        $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

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

Config

Code:
$config['index_page'] = '';
$config['base_url'] = '';
#2

[eluser]TheFuzzy0ne[/eluser]
What do you mean by:
Quote:but it starts error about
Code:
<!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.
#3

[eluser]Unknown[/eluser]
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