Welcome Guest, Not a member yet? Register   Sign In
use CI as micro engine without views folder
#1
Lightbulb 
(This post was last modified: 04-18-2017, 02:26 AM by ardavan.)

Hi guys,

I'm working on a project which is an engine to do something based on inputs.
This project is using controller and model only to read / save manipulated data or return some results to the referrer URL.

I wanna hide this engine-CI view pages from users who wants to have direct access to the views or search engines.
My question is how to delete/redirect/block the direct URLs to my engine-CI?

Thanks guys

Attached Files Thumbnail(s)
   
Reply
#2

You need to implement authorization methods in engine-CI. 

you can build engine-CI as an ReSTful api 
https://github.com/chriskacerguis/codeig...restserver
Reply
#3

(04-18-2017, 03:21 AM)neuron Wrote: You need to implement authorization methods in engine-CI. 

you can build engine-CI as an ReSTful api 
https://github.com/chriskacerguis/codeig...restserver

I'm planing to make the CI as an API but what will happen if user directly insert http:// example.com/engine/ then the CI will display the default route which is 'welcome'. I wanna screw the view or direct access like http://example.com/engine/reports

Sorry maybe my question sounds silly but it's my first time to do this. Please guide me more

Thanks
Reply
#4

I am also noob Smile

how about filterin by IP in htaccess ? or in index.php  check remote IP address.

if u implement ReST API. rest server this library has built in authentication methods. in rest library config u can set valid user that are able to connect to ur engine-ci api
$config['rest_valid_logins'] = ['admin' => '1234'];
or u can set IP whitelist $config['rest_ip_whitelist_enabled'] = FALSE;

if connection is not secure (not https) $config['rest_valid_logins'] = ['admin' => '1234']; is not secure
Reply
#5

You can change the default route in config/routes.php and point it to a controller with a method which uses show_404() if that is the desired effect (https://codeigniter.com/user_guide/gener...=#show_404).
Reply




Theme © iAndrew 2016 - Forum software by © MyBB