Welcome Guest, Not a member yet? Register   Sign In
Moving everything from root to a subfolder
#1

I am about to install a small (but very useful) "Coming Soon" set of pages available here https://prelauncher.net which, as far as I could understand after downloading it, has been created using CodeIgniter. If I manage to let it work as expected, such tool will be useful to gather some contacts before I open my small website.
All the system comes inside a /prelauncher/ folder, which is nice and tidy.
Now: if I take all the files and folders that I find in there, place them at root level, and type say https://example.com it all works fine.
If instead (as I would prefer to) I keep all the package inside its own /prelauncher/ folder and type something like https://example.com/prelauncher/ then the system does not seem to work as it should.
Where is the trick, please?
I read the manual, but it is far from clear (unless you already know how such things should work) and real examples are not available. 

In short: if the whole thing works when all files are placed at root level, what and how should be changed in order to let it run when all the files are placed inside a /subfolder/ please?

Thanks!
Reply
#2

edit config.php

$config['base_url'] = 'https://example.com/prelauncer/';
Reply
#3

@kirpi

See this project: https://github.com/ivantcholakov/codeign...erver-test

If you download it and place it within a sub-folder it will just work. There is custom URL-autodetection included, examine the sources.
Reply
#4

(07-11-2017, 03:16 PM)my_RZ Wrote: edit config.php

$config['base_url'] = 'https://example.com/prelauncer/';

I went to application/config/config.php and changed this line:

Code:
$config['base_url']  = get_domain();
into

Code:
$config['base_url']  = "https://example.com/prelauncher/";
[I mean, the real domain] yet nothing seems to change, even when trying on different browsers and cleaning the cache.

Also, I noticed that, along with other folders and files inside /prelauncher/ (application, assets, database, system, uploads, index.php,...)
there is a .htaccess file.
There, I tried and change this:

Code:
 ...
  # If your page resides at
  #  http://www.example.com/mypage/test1
  # then use
  # RewriteBase /mypage/test1/
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L]
 ...
into this:

Code:
 ...
  # If your page resides at
  #  http://www.example.com/mypage/test1
  # then use
  # RewriteBase /mypage/test1/
  RewriteBase /prelauncher/
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L]
 ...
but again nothing changes...

It seems that I am stucked.

Now I will try ivantcholakov's suggestion, although I definitely believe there the solution should be the first one...
Where am I wrong, please?
Reply
#5

(This post was last modified: 07-12-2017, 09:40 AM by my_RZ.)

(07-12-2017, 05:30 AM)kirpi Wrote:
(07-11-2017, 03:16 PM)my_RZ Wrote: edit config.php

$config['base_url'] = 'https://example.com/prelauncer/';

I went to application/config/config.php and changed this line:

Code:
$config['base_url']  = get_domain();
into

Code:
$config['base_url']  = "https://example.com/prelauncher/";
[I mean, the real domain] yet nothing seems to change, even when trying on different browsers and cleaning the cache.

Also, I noticed that, along with other folders and files inside /prelauncher/ (application, assets, database, system, uploads, index.php,...)
there is a .htaccess file.
There, I tried and change this:

Code:
 ...
  # If your page resides at
  #  http://www.example.com/mypage/test1
  # then use
  # RewriteBase /mypage/test1/
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L]
 ...
into this:

Code:
 ...
  # If your page resides at
  #  http://www.example.com/mypage/test1
  # then use
  # RewriteBase /mypage/test1/
  RewriteBase /prelauncher/
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L]
 ...
but again nothing changes...

It seems that I am stucked.

Now I will try ivantcholakov's suggestion, although I definitely believe there the solution should be the first one...
Where am I wrong, please?


remove trailing slash
in your .htaccess
RewriteBase /prelauncher
Reply
#6

Also

Code:
RewriteBase /prelauncher
does not work.

Most probably this CodeIgniter thing is something useful but way too difficult and technical for me.

I will stay content in taking all the files out of their /prelauncher/ folder and placing them at root level.

Thank you all the same :-)
Reply
#7

If the ./application and ./system folders are moved to the root
and index.php is in say public then you need to edit the index.php
file and point the ./application and ./system folders to the correct
folders.

usually ../application and ../system
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#8

(07-11-2017, 01:58 PM)kirpi Wrote: I am about to install a small (but very useful) "Coming Soon" set of pages available here https://prelauncher.net which, as far as I could understand after downloading it, has been created using CodeIgniter. If I manage to let it work as expected, such tool will be useful to gather some contacts before I open my small website.
All the system comes inside a /prelauncher/ folder, which is nice and tidy.
Now: if I take all the files and folders that I find in there, place them at root level, and type say https://example.com it all works fine.
If instead (as I would prefer to) I keep all the package inside its own /prelauncher/ folder and type something like https://example.com/prelauncher/ then the system does not seem to work as it should.
Where is the trick, please?
I read the manual, but it is far from clear (unless you already know how such things should work) and real examples are not available. 

In short: if the whole thing works when all files are placed at root level, what and how should be changed in order to let it run when all the files are placed inside a /subfolder/ please?

Thanks!

I DLed the package from your linked site (nice - might use it myself).  It is a "prepackaged" CI application I guess meant to be run from the domain root (http://mysite.com).  It contains all the CI application and system files for a standalone app.  

You can use this and add your own app files or extract the prelauncher specific files (the Application folder) and merge it into your existing project.  I would suggest running the prelauncher at the root of your domain and develop your application as a subdomain (http://mysite.com/dev).  When ready, blow away the prelauncher, migrate release code to the root, tweak configs. 

Just my $.02 - good luck and don't give up the ship

Regards,
--Wolf--
Reply




Theme © iAndrew 2016 - Forum software by © MyBB