Skip to content

Commit

Permalink
IP-450 - Find more suitable solution for the URL problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Kovah committed Oct 25, 2016
1 parent 06d9244 commit da2918a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 18 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
#### _Version 1.4.8_ #### _Version 1.4.8_


InvoicePlane is a self-hosted open source application for managing your invoices, clients and payments. InvoicePlane is a self-hosted open source application for managing your invoices, clients and payments.
For more information visit __[InvoicePlane.com](https://invoiceplane.com)__ or take a look at the __[demo](https://demo.invoiceplane.com)__ For more information visit __[InvoicePlane.com](https://invoiceplane.com)__ or try the __[demo](https://demo.invoiceplane.com)__.


### Quick Installation ### Quick Installation


1. Download the [latest version](https://invoiceplane.com/downloads) 1. Download the [latest version](https://invoiceplane.com/downloads)
2. Extract the package and copy all files to your webserver / webspace. 2. Extract the package and copy all files to your webserver / webspace.
3. Open `http://your-invoiceplane-domain.com/index.php/setup` and follow the instructions. 3. Set your URL in the `index.php` file.
4. Open `http://your-invoiceplane-domain.com/index.php/setup` and follow the instructions.


#### Remove `index.php` from the URL #### Remove `index.php` from the URL


Expand Down
3 changes: 1 addition & 2 deletions application/config/config.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
| path to your installation. | path to your installation.
| |
*/ */
$config['protocol'] = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://'); $config['base_url'] = IP_URL;
$config['base_url'] = $config['protocol'] . ($_SERVER['HTTP_HOST'] ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']) . URL_SUBFOLDER;


/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
Expand Down
50 changes: 36 additions & 14 deletions index.php
Original file line number Original file line Diff line number Diff line change
@@ -1,9 +1,36 @@
<?php <?php


/* /*
*--------------------------------------------------------------- * ---------------------------------------------------------------
* Basic InvoicePlane Settings
* ---------------------------------------------------------------
*
* Please set your preferred URL for IP_URL like this:
* define('IP_URL', 'https://my-invoices.com/');
* If you want to use a sub-domain, add it to the URL like this:
* define('IP_URL', 'https://my-domain.com/invoices/');
* for local environments withour any domains you may use this:
* define('IP_URL', 'http://localhost/invoices/');
*
* ---------------------------------------------------------------
* If you have any problems with the application you may set the
* debug setting to 'true' which enables additional logging which
* is helpful for finding the cause of the problems.
*/

define('IP_URL', '');

define('IP_DEBUG', false);

/*
* DO NOT EDIT BELOW THIS LINE!
* ---------------------------------------------------------------
*/

/*
* ---------------------------------------------------------------
* APPLICATION ENVIRONMENT * APPLICATION ENVIRONMENT
*--------------------------------------------------------------- * ---------------------------------------------------------------
* *
* You can load different configurations depending on your * You can load different configurations depending on your
* current environment. Setting the environment also influences * current environment. Setting the environment also influences
Expand All @@ -20,17 +47,15 @@
*/ */


if (is_dir(__DIR__ . "/application/config/development")) { if (is_dir(__DIR__ . "/application/config/development")) {
define('IP_DEBUG', true);
define('ENVIRONMENT', 'development'); define('ENVIRONMENT', 'development');
} else { } else {
define('IP_DEBUG', false);
define('ENVIRONMENT', 'production'); define('ENVIRONMENT', 'production');
} }


/* /*
*--------------------------------------------------------------- * ---------------------------------------------------------------
* ERROR REPORTING * ERROR REPORTING
*--------------------------------------------------------------- * ---------------------------------------------------------------
* *
* Different environments will require different levels of error reporting. * Different environments will require different levels of error reporting.
* By default development will show errors but testing and live will hide them. * By default development will show errors but testing and live will hide them.
Expand All @@ -53,9 +78,9 @@
} }


/* /*
*--------------------------------------------------------------- * ---------------------------------------------------------------
* SYSTEM FOLDER NAME * SYSTEM FOLDER NAME
*--------------------------------------------------------------- * ---------------------------------------------------------------
* *
* This variable must contain the name of your "system" folder. * This variable must contain the name of your "system" folder.
* Include the path if the folder is not in the same directory * Include the path if the folder is not in the same directory
Expand All @@ -65,9 +90,9 @@
$system_path = 'system'; $system_path = 'system';


/* /*
*--------------------------------------------------------------- * ---------------------------------------------------------------
* APPLICATION FOLDER NAME * APPLICATION FOLDER NAME
*--------------------------------------------------------------- * ---------------------------------------------------------------
* *
* If you want this front controller to use a different "application" * If you want this front controller to use a different "application"
* folder then the default one you can set its name here. The folder * folder then the default one you can set its name here. The folder
Expand Down Expand Up @@ -189,9 +214,6 @@
define('APPPATH', BASEPATH . $application_folder . '/'); define('APPPATH', BASEPATH . $application_folder . '/');
} }


// Detect the URL subfolder
define('URL_SUBFOLDER', ($_SERVER['DOCUMENT_ROOT'] != str_replace('\\', '/', dirname(__FILE__)) ? str_replace($_SERVER['DOCUMENT_ROOT'], '', str_replace('\\', '/', dirname(__FILE__))) : ''));

// Set the uploads folder // Set the uploads folder
define('UPLOADS_FOLDER', FCPATH . 'uploads/'); define('UPLOADS_FOLDER', FCPATH . 'uploads/');


Expand All @@ -206,4 +228,4 @@
require_once BASEPATH . 'core/CodeIgniter.php'; require_once BASEPATH . 'core/CodeIgniter.php';


/* End of file index.php */ /* End of file index.php */
/* Location: ./index.php */ /* Location: ./index.php */

0 comments on commit da2918a

Please sign in to comment.