Search code examples
php.htaccesscodeigniteruploadify

Codeigniter : what if I want both URL with index.php and without index.php work


I want both index.php included, and index.php excluded from my URIs to work smoothly on my site. I need it because of uploadify not working, and it is giving me a HTTP error.

It works if I have changed this

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

to this

$config['uri_protocol'] = 'QUERY_STRING';

, but then whole system is not working properly.


Solution

  • For your assets, first, on config.php set the $config['base_url'] to your website URL.

    Then, when linking to assets on which you do NOT want index.php, just use the function base_url

    <?php echo base_url("assets/uploadify/uploadify.swf"); ?>
    // Generates http://URL/assets/uploadify/uploadify.swf