Welcome Guest, Not a member yet? Register   Sign In
.htaccess for admin panel
#21

[eluser]Aken[/eluser]
Use whichever one makes your app work. It can vary by hosting environment. It impacts how CodeIgniter figures out what the current URL is.
#22

[eluser]noslen1[/eluser]
Finally made it !
Here's my full code and folder structure :
Code:
/back/ // admin application
    /cache/
    /config/
    /controllers/
    /...
    /.htaccess
/front/ // public site application
    /cache/
    /config/
    /controllers/
    /...
    /.htaccess
/system/ // CI system core
    /core/
    /database/
    /...
/www/  // Static assets
    /back/
        /css/
        /img/
        /js/
    /front/
        /css/
        /img/
        /js/
/.htaccess
/admin.php // Routing to /back/
/index.php // Routing to /front/


/.htaccess
Code:
<IfModule mod_rewrite.c>
    RewriteEngine on
  
    # Admin URLs
    RewriteRule ^admin(/.*)?$ admin.php/$1 [L,QSA]
  
    # Public website
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond $1 !^(img|css|js)
    RewriteRule ^(.*)$ index.php/$1 [QSA,L]
</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 index.php
</IfModule>


/admin.php
Code:
...
$application_folder = 'back';


/index.php
Code:
...
$application_folder = 'front';


/back/config/config.php
Code:
...
$config['index_page'] = 'admin';
$config['uri_protocol'] = 'PATH_INFO';


/front/config/config.php
Code:
...
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';


Thanks a lot for helping guys ! Tongue
#23

[eluser]Unknown[/eluser]
[quote author="noslen1" date="1350465634"]Finally made it !
Here's my full code and folder structure :
Code:
/back/ // admin application
    /cache/
    /config/
    /controllers/
    /...
    /.htaccess
/front/ // public site application
    /cache/
    /config/
    /controllers/
    /...
    /.htaccess
/system/ // CI system core
    /core/
    /database/
    /...
/www/  // Static assets
    /back/
        /css/
        /img/
        /js/
    /front/
        /css/
        /img/
        /js/
/.htaccess
/admin.php // Routing to /back/
/index.php // Routing to /front/


/.htaccess
Code:
<IfModule mod_rewrite.c>
    RewriteEngine on
  
    # Admin URLs
    RewriteRule ^admin(/.*)?$ admin.php/$1 [L,QSA]
  
    # Public website
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond $1 !^(img|css|js)
    RewriteRule ^(.*)$ index.php/$1 [QSA,L]
</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 index.php
</IfModule>


/admin.php
Code:
...
$application_folder = 'back';


/index.php
Code:
...
$application_folder = 'front';


/back/config/config.php
Code:
...
$config['index_page'] = 'admin';
$config['uri_protocol'] = 'PATH_INFO';


/front/config/config.php
Code:
...
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';


Thanks a lot for helping guys ! Tongue[/quote]

/

*****************
/back/ // admin application does this means whole ci
/front/ // public site application does this means another whole ci

is this your structure
ci Main->ci front
ci Main->ci Back
??????????




Theme © iAndrew 2016 - Forum software by © MyBB