php - Codeigniter URL redirection and routing -
I am trying to redirect URL with codicular routing. I can not write writing for the following
If the URL comes with That means if a URL starts with which tries to map the codeinator URL routing. I'm trying with codeigniter URL routing technology but I am not able to get it. Does the URL redirect to the codeigner level with the compression server side redirection or is there a better way to do this? Solution 1. Using Codeigner Routing View it in your In a You need to set your default controller to Solution 2. Using .htaccess page redirection / api / some / some then I'll call it
api / some / some , otherwise I can copy the URL to
/ I want to redirect to home / index .
api / , then I do not want other intelligent users to change that URL, because I want it to be the default controller
home / index
$ route ['API / (: any)'] = 'API / (: any)'; $ Route ['(: any)'] = 'home / index' ';
application / config / routes.php
$ route ['API / (: any)'] = "API / $ 1"; $ Route ['(: any)'] = "home / index / $ 1"; $ Route ['default_controller'] = "home";
() fashion for a match, you must add the related
$ 1 or
$ 2 ,
$ 3 .. Based on that condition,
() patter first
() its $ 1, second
() for its
$ 2 and so on.
Home .
Reviving OnReitRound code% {REQUEST_URI}! ^ / Api (. *) $ Rewrite% {REQUEST_URI}! ^ / home / index $ RewriteRule ^. * $ / home / index [R = 301, QSA, L]
Comments
Post a Comment