Routes Issue

Hi All,

sorry to disturbed all of u , today i am facing a big problem ,let me explain my problem
my problem is relevant to URL Rewriting,

i am making a site in multilingual my URL is current become like this

but i want URL in this way

i want to remove the function name from my URL
can anybody help me to get rid of this problem.

Thanks in Advance.
Take Care.

Have you even read the user guide, theres a nice section on URI routing

Once you've tried that and are still stuck, post back what code you've got and we can help you some more

hi thanks for quick reply

i write in routes file

$route['page/(.+)'] = "page/index/$1";

but my problem is i want to add language code before the controller and eliminate the function name , bcz it make URL too long,which i dont want

if u have some other idea plz let me know.



i set the route but its not work fine can someone guide me ,

$route[‘fr/page/(.+)’] = “fr/page/index/$1”;


Why are you passing the function name into the index method?
Do you not want something like:
$route['(en|fr|de|etc)/page/(.+)'] = 'page/$2';

yes i want this
but problem is that my url should become like that sir

here residential is not function its category name ,
what i want to remove the function name from my url


Oh, right, I assumed seeing as you where passing something into index and said you wanted to get rid og function name, you where doing some huge switch in your index function

So assuming you have a function call search_by_category, you could use
$route['(en|fr|de|etc)/auction/(:any)'] = 'auction/search_by_category/$2';
Where $2 is the category in the URL

is it possible to do that
to put language code in start then controller name and the id not function name ,
my mind is stuck now,

help me get rid of this problem

I've not tested it, but there's no reason I see why it wouldn't work
You can do almost anything with routes Smile Just a little bit of reading the User Guide and trial and error

Hi Sir,

hope u will be fine , i solve my problem thanks for urs reply i need to ask one more question Smile
can we write one route which is consider first argument as language code , right now for each function
i have to write this type of routes,

$route['(en|sp|por|pol|chn)/auction/signup'] = 'auction/signup';
$route['(en|sp|por|pol|chn)/auction/login'] = 'auction/login';
$route['(en|sp|por|pol|chn)/auction/forgetpassword'] = 'auction/forgetpassword';

i think this is not a good approach i am really new in routes/htacess,

Thanks in Advance.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.