0

I am a beginer in codeigniter and .htaccess. my controller folderis something like

/controller
    index.php
    site.php

    /admin
        login.php

my problem is, when I access a function sample() which is in "login.php", the url is like

"http://localhost/folder1/admin/login/sample" 

is there any way to hide the "login" part using .htaccess. If some one give me an answer, it will be a great help for me. Thank you...

3
  • 1
    you can use config/routes.php for this Commented Mar 23, 2014 at 16:54
  • thank you for the reply. Can you please tell how to do that? Commented Mar 23, 2014 at 17:05
  • ellislab.com/codeigniter/user-guide/general/routing.html Commented Mar 23, 2014 at 17:10

1 Answer 1

7

You don't need to change in your .htacees. In your routes.php, write this:

$route['admin/sample'] = "admin/login/sample";

I hope this will help.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.