Welcome Guest, Not a member yet? Register   Sign In
How to create admin panel
#11

[eluser]JasmineFlower[/eluser]
My .htaccess file

Code:
RewriteEngine on

RewriteBase /icadnxgen

RewriteRule ^admin/$ index.php/admin/login/
RewriteRule ^admin$ index.php/admin/login/


it is correct or not ?
#12

[eluser]JasmineFlower[/eluser]
Hi InsiteFX,

In my application/config/config.php file having auto load function
#13

[eluser]CrossMotion[/eluser]
You don't need to add rules to the .htaccess file for this. you just need to send everything to index.php so that the CodeIgniter route class can handle it.

Just change your .htaccess file to this.

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|img|css|scripts|robots\.txt|favicon.ico|animated_favicon1.gif)
RewriteRule ^(.*)$ /index.php/$1 [L]

In the RewriteCond part you can add directories and files that you dont want to get handled by CodeIgniter. add things like your images, css and javascript folders here. you can separate them with a pipe.
#14

[eluser]CrossMotion[/eluser]
[quote author="JasmineFlower" date="1306337198"]Hi InsiteFX,

In my application/config/config.php file having auto load function[/quote]

You can autoload functions in your application/config/autoload.php file.

Check http://ellislab.com/codeigniter/user-gui...oader.html.

Simply put, in application/config/autoload.php, change this:

Code:
$autoload['helper'] = array();
to this:
Code:
$autoload['helper'] = array('url');

By the way, if you don't know basic stuff like this. Maybe you should start with the tutorials. They give you a basic understanding of how CodeIgniter works.
#15

[eluser]JasmineFlower[/eluser]
thank you Cross
#16

[eluser]CrossMotion[/eluser]
You're welcome.

Did this solve the problem for you?
#17

[eluser]JasmineFlower[/eluser]
Hi Cross,

I solved this problem by using .htaccess & routes.php file

my .htaccess file

Code:
RewriteEngine on

RewriteBase /foldername

RewriteRule ^admin/$ index.php/admin/login/
RewriteRule ^admin$ index.php/admin/login/

RewriteRule ^(.*)$ index.php/$1


and my routes.php

Code:
$route['default_controller'] = 'home';
$route['404_override'] = '';

$route['admin']= 'admin/login/index' ;
#18

[eluser]JasmineFlower[/eluser]
Thank You Cross
#19

[eluser]JasmineFlower[/eluser]
Thank you InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB