.htaccess for admin panel |
[eluser]NiconPhantom[/eluser]
Where your application is hosted? Is it your own server on WAMP/ LAMP? Do you have any .htaccess inside blob/ ? If you will temporary remove it, will you see 403? Sounds like: http://www.cyberciti.biz/faq/apache-403-...-solution/
[eluser]noslen1[/eluser]
Yes CI is installed on my localhost on WAMP. If I remove /blob/.htaccess, I don't get a 403 but 404 error
[eluser]NiconPhantom[/eluser]
what if you will try /blob/index.php or any other file directly, will it still trigger 404? Make sure you have mod_rewrite enabled for Apache -> WAMP, otherwise it will give 404 for .htaccess routes I found following picture which might be useful: http://docs.tomatocms.com/images/4/40/Wa...module.jpg
[eluser]noslen1[/eluser]
Of course my mod_rewrite is enabled in Apache. I don't have index.php in my /blob directory. My folders structure looks like : Code: /blob/ If I try to access /blob.php, I successfully arrive on my admin login page (the default login controller), then I submit the form and it's trying to send me to localhost/muki/login, instead of localhost/muki/blob/login or localhost/muki/blob.php/login
[eluser]NiconPhantom[/eluser]
Do you have HMVC like https://bitbucket.org/wiredesignz/codeig.../wiki/Home? If no, then it will be easier for you to have it to separate different apps and use routing instead of .htaccess
[eluser]noslen1[/eluser]
Nope I don't have HMVC. Should I get into it or should I rearrange my folder structure ? What would be the most typical and easiest way to structure a backend application besides a frontend in CI ?
[eluser]NiconPhantom[/eluser]
I am using HMVC and my structure looks like: Applications Modules admin/ controllers views models frontend/ controllers views models So basically in routes.config I have default website = frontend/front_controller and $route['admin']= 'admin/backend_controller' With HMVC you will have modular structure without any .htacces or php file which will route from one location to another. The only .htaccess I have is posted above and it's just to hide index.php
[eluser]noslen1[/eluser]
Okkkkk I understood what you meant by not naming the folder as /admin Aken ! Folder structure : Code: /administrator/ /admin.php Code: $application_folder = 'administration'; /site/config/config.php AND /administrator/config/config.php Code: $config['base_url'] = ''; And kept the same .htaccess you gave me. Accessing http://localhost/muki/admin throws me a 404 But, when I change URI_PROTOCOL to PATH_INFO or QUERY_STRING or ORIG_PATH_INFO, i got my login form displayed, without any style, although the called CSS localhost/muki/www/admin/css/screen.css is the correct path. Don't know if this can help you to find out the issue. Think we're not too far from the solution.
[eluser]Aken[/eluser]
If you have static assets in an /admin/ folder, you'll need to add the same RewriteCond conditions that the index.php rewrite rule has to above the admin RewriteRule. Read the comments in the .htaccess example I gave you.
[eluser]noslen1[/eluser]
Ok thanks, I'll take a look at that. And what URI_PROTOCOL should I use, and why ? What does it impact ? |
Welcome Guest, Not a member yet? Register Sign In |