1

This belove is my url. so how can i remove/hidden

home/post 

from the url

http://localhost/likes/home/post/sports/Secret-Weapons-for-Top-NFL-Teams-/13

and

     admin/ad_managment

from

   http://localhost/likes/admin/ad_managment/edit/2

thanks

4 Answers 4

3

Try this I haven't tried this should work,

$route['(:any)/(:num)'] = "admin/ad_managment/$1/$2";
$route['(:any)/(:any)/(:num)'] = "home/post/$1/$2/$3";

See more http://ellislab.com/codeigniter/user-guide/general/routing.html

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

1 Comment

2

check user guide of codeigniter and in this example see how the routing done. Read more about code-igniter routing

Comments

0

Write into application/config/routes.php

$route['(:any)/(:any)/(:num)'] = "home/post/$1/$2/$3";

And now, you can use like following format:

http://localhost/likes/sports/Secret-Weapons-for-Top-NFL-Teams-/13

Uri Routing Document: http://ellislab.com/codeigniter/user-guide/general/routing.html

3 Comments

Your base url http://localhost/likes/ or http://localhost/? And what you get?
Hmm you get any error? and home controller, post method, and have 3 params, is it right?
ya home controller, post method, and have 3 params
0

use .htaccess to rewrite the url.
http://www.pets.com/pet_care_info_07_07_2008.php
RewriteEngine On # Turn on the rewriting engine
RewriteRule ^pet-care/?$ pet_care_info_01_02_2008.php [NC,L]
# Handle requests for "pet-care"

https://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/

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.