Asked  7 Months ago    Answers:  5   Viewed   37 times

when I had my site on development environment - it was url:

Now on production server my codeigniter app's address has to be

I moved it there, and everytime I'm trying to run some function, example /home/test - it gets me into - which is WRONG.

It has to be - How to fix it? I did set

$config['base_url'] =



Base URL should be absolute, including the protocol:

$config['base_url'] = "";

If using the URL helper, then base_url() will output the above string.

Passing arguments to base_url() or site_url() will result in the following (assuming $config['index_page'] = "index.php";:

echo base_url('assets/stylesheet.css'); //
echo site_url('mycontroller/mymethod'); //
Wednesday, March 31, 2021
answered 7 Months ago

I've used PHPExcel with CodeIgniter successfully before.

All I did was drop the phpexcel folder into application/third-party and created the following wrapper library:


class Excel {

    private $excel;

    public function __construct() {
        // initialise the reference to the codeigniter instance
        require_once APPPATH.'third_party/phpexcel/PHPExcel.php';
        $this->excel = new PHPExcel();    

    public function load($path) {
        $objReader = PHPExcel_IOFactory::createReader('Excel5');
        $this->excel = $objReader->load($path);

    public function save($path) {
        // Write out as the new file
        $objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5');

    public function stream($filename) {       
        header('Content-type: application/ms-excel');
        header("Content-Disposition: attachment; filename="".$filename."""); 
        header("Cache-control: private");        
        $objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5');

    public function  __call($name, $arguments) {  
        // make sure our child object has this method  
        if(method_exists($this->excel, $name)) {  
            // forward the call to our child object  
            return call_user_func_array(array($this->excel, $name), $arguments);  
        return null;  


I could then do the following in my controllers:

$this->excel->getActiveSheet()->SetCellValue('B2', "whatever");

Hope this helps you out?

Wednesday, March 31, 2021
answered 7 Months ago

the problem is that the excel file is saved version 5, then I should Register with the 2007 version (. xlsx) and the Arabic values ??appear correctly in file properities:

$obj_writer = PHPExcel_IOFactory::createWriter($this->excel, 'Excel2007');
Saturday, May 29, 2021
answered 5 Months ago

Your RewriteCond is a bit wonky. I'm surprised it does anything at all, since it would seem to be trying to match the host against the pattern These directives worked for me:

# Redirect www to non-www
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1$1 [L,R=301]
Thursday, September 16, 2021
The Coding Wombat
answered 1 Month ago

I think what I'm looking for is to add the following to the file:

project.root = ${basedir}

alternatively, I can just use the basedir property whenever project.root is needed.

I happened to be looking at the source code for and I saw the basedir property being used. I just tested and verified that this property works on different machines both from inside eclipse and from the command line as well as when making a call to ant from a different directory such as:

ant -f /path/to/eclipse/workspace/projectName/build.xml

When I get a minute, I will verify that this also works when importing the property file in different locations (such as inside src/main/resources/config/ivy/ivysettings.xml).

Monday, September 27, 2021
answered 1 Month ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :