Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to Add a prefix to every URL in CakePHP?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 586
    Comment on it

    Hello Reader!
    If you looking to fix a default language prefix for your all url in cakePhp then you can follow the steps which is the easiest and clean way :-

    Open file routes.php from the location Config/routes.php

    There in first line write the code as below

    Router::prefix('admin', function($routes) {
        // All routes here will be prefixed with `/admin`
         });
    

    Now every url will have /admin/ as its prefix default

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: