Welcome Guest, Not a member yet? Register   Sign In
Trailing Slash (Front & Back) Sharing libs and models
#1

[eluser]Ignacio[/eluser]
Code:
system/application/controllers
system/application/controllers/admin
system/application/models
system/application/libraries
system/application/views
system/application/views/admin
assets/admin/img
assets/admin/css
assets/admin/js
assets/img
assets/css
assets/js

I have a problem with the trailing slash!!!!!
I'm using all the CI on subfolders, but I don't know if that a problem here. Check my example.

site.com/clients/client/ -> frontend
site.com/clients/clients/admin/ > backend

site.com/clients/client -> without "/" the system add it automatically, so, it works fine
site.com/clients/client/admin -> without "/" isn't work

I'm using ElliotHaughin's htaccess with just a line change:
Code:
RewriteBase /clients/client/

Maybe you don't like my structure, but it work fine for me on small apps.

Any ideas?
#2

[eluser]sikkle[/eluser]
Humm copy here the .htaccess file, and also your routes. Will start by that.
#3

[eluser]Ignacio[/eluser]
Routes
Code:
$route['default_controller'] = "main"; //home frontend
$route['admin'] = "admin/main"; //home backend (login)
$route['admin/:any'] = "admin/$1"; //I don't know if this is ok

.htaccess
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /clients/client
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php
</IfModule>
#4

[eluser]Ignacio[/eluser]
Ok, talking with sikkle and wiredesignz[h], my idea was a mess, so I did it with http://ellislab.com/codeigniter/user-gui..._apps.html for two separate apps.

Structure
Code:
.htaccess
index.php
admin/.htaccess
admin/index.php
system/application/admin
system/application/public

Important, check this file: admin/index.php #26
Code:
$system_folder = "../system";

I don't know if doing that is secure or not, but it works great.

Thanks folks.




Theme © iAndrew 2016 - Forum software by © MyBB