mark yorky
mark yorky

Reputation: 193

CodeIgniter Ion Auth pages outside auth folder

I am very new to CodeIgniter Ion Auth, I was wondering if it is possible to add pages, outside the auth folder? the pages can be accessed only if the user is logged in. The main reason why I wanted the pages outside the auth folder is that I want to get rid of the "auth" in the url. Any help would be greatly appreciated. By the way, I only tried adding pages inside the auth folder. Thanks!

Upvotes: 0

Views: 600

Answers (1)

user1678293
user1678293

Reputation: 95

The short answer is Yes, you can. But if the reason is simply to remove the "auth" in the URL, the easiest way to achieve this is by using routes settings (located in the \application\config\routes.php file)

For example, if you set;

$route['login'] = 'auth/login';

The URL to the log in page will be;

http://yourdomain.com/index.php/login

You can go a step further by adding URL suffix in codeigniter config settings ( \application\config\config.php)

$config['url_suffix'] = '.html';

so that the URL to the log in page will be;

http://yourdomain.com/index.php/login.html

You can even remove the /index.php part of the URL. See this forum here

Upvotes: 3

Related Questions