Permalink
Browse files

IP-450 - Find more suitable solution for the URL problems

1 parent 06d9244 commit da2918a2b26e21ec51e5f71c2138db01861523f7 @Kovah Kovah committed Oct 25, 2016
Showing with 40 additions and 18 deletions.
  1. +3 −2 README.md
  2. +1 −2 application/config/config.php
  3. +36 −14 index.php
View
@@ -2,13 +2,14 @@
#### _Version 1.4.8_
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
1. Download the [latest version](https://invoiceplane.com/downloads)
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
@@ -14,8 +14,7 @@
| path to your installation.
|
*/
-$config['protocol'] = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://');
-$config['base_url'] = $config['protocol'] . ($_SERVER['HTTP_HOST'] ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']) . URL_SUBFOLDER;
+$config['base_url'] = IP_URL;
/*
|--------------------------------------------------------------------------
View
@@ -1,9 +1,36 @@
<?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
- *---------------------------------------------------------------
+ * ---------------------------------------------------------------
*
* You can load different configurations depending on your
* current environment. Setting the environment also influences
@@ -20,17 +47,15 @@
*/
if (is_dir(__DIR__ . "/application/config/development")) {
- define('IP_DEBUG', true);
define('ENVIRONMENT', 'development');
} else {
- define('IP_DEBUG', false);
define('ENVIRONMENT', 'production');
}
/*
- *---------------------------------------------------------------
+ * ---------------------------------------------------------------
* ERROR REPORTING
- *---------------------------------------------------------------
+ * ---------------------------------------------------------------
*
* Different environments will require different levels of error reporting.
* By default development will show errors but testing and live will hide them.
@@ -53,9 +78,9 @@
}
/*
- *---------------------------------------------------------------
+ * ---------------------------------------------------------------
* SYSTEM FOLDER NAME
- *---------------------------------------------------------------
+ * ---------------------------------------------------------------
*
* This variable must contain the name of your "system" folder.
* Include the path if the folder is not in the same directory
@@ -65,9 +90,9 @@
$system_path = 'system';
/*
- *---------------------------------------------------------------
+ * ---------------------------------------------------------------
* APPLICATION FOLDER NAME
- *---------------------------------------------------------------
+ * ---------------------------------------------------------------
*
* If you want this front controller to use a different "application"
* folder then the default one you can set its name here. The folder
@@ -189,9 +214,6 @@
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
define('UPLOADS_FOLDER', FCPATH . 'uploads/');
@@ -206,4 +228,4 @@
require_once BASEPATH . 'core/CodeIgniter.php';
/* End of file index.php */
-/* Location: ./index.php */
+/* Location: ./index.php */

0 comments on commit da2918a

Please sign in to comment.