![]() |
can't access subdir after changing htaccess - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: can't access subdir after changing htaccess (/showthread.php?tid=12694) |
can't access subdir after changing htaccess - El Forum - 10-28-2008 [eluser]hcvitto[/eluser] Hi i'm working the first time with CI so i need a bit of support to get me going ![]() I got an app which works fine with the htaccess file but i can't get to the Admin subdir. This is the structure of my app in the application folder: CONTROLLERS --main.php (contains all of the functions) --admin (dir) --admin.php (calls the views/admnin/login.php) VIEWS --view files --admin (dir) --login.php and here's my htaccess in the application root <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /app_labitta/ (name of the application) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/main/$1 [L] </IfModule> I tried this but with no avail! RewriteRule ^(.*)$ index.php/main/$1 [L] RewriteRule ^(.*)/admin/$ index.php/admin/main/$1 [L] How can i get to see the admin area? Is it possible to use more rewrite rules and/or more rewrite Base? Any idea or error spot? Thanks Vitto can't access subdir after changing htaccess - El Forum - 10-28-2008 [eluser]OES[/eluser] In your controller you cant have the same name as a folder. admin.php admin -> folder If you want an admin area use the admin folder and create a new controller in it ie page.php so admin/page.php then route all /admin calls the the page controller. Dont forget to remove admin.php from the base controller. ! can't access subdir after changing htaccess - El Forum - 10-28-2008 [eluser]hcvitto[/eluser] mmh, sorry but the formatting of my post has gone!! i actually have an admin.php page inside the admin directory.. CONTROLLERS main.php (contains all of the functions) admin (dir) --> admin.php (the admin dir contains the admin.php file) VIEWS view files.php admin (dir) --> login.php I hope it's better now ![]() |