php - Convert slash to tilde as Url Separator -


I have a question about how we can separate the URL with a slash instead of a slash, for example I have A URL is:

The first case

  www.domain.com/category/category_id The URL shown will be www.domain.com/category/category_id   

The second case

  www.domain.com/category/subcategory/category_id The URL shown will be www.domain.com/category/subcategory/category_id   

So we will be separating the URL when we have such a position And only the last section will be affected. How Can We Do It In Php I'm Trying To Work In Laravel!

Thanks

  1. Create .htaccess in your www root Put it in and put it in:

    Click to rewrite the revetting engine% {SCRIPT_FILENAME}! -d
    revoked% {SCRIPT_FILENAME}! -f
    revised rule ^ (. *) $ Index.php? Params = $ 1 [QSA]

  2. To get the parameter used in index.php:

    ...
    $ Params = Explosion ('/', $ _GET ['param']);
    $ Last Two = Explosions ('~', $ Parameters [Count ($ Parameter - 1]);
    if (calculation ($ LastTwo) == 2) {$ $ params [count ($ params) - 1] = $ last two [0];
    $ params [] = $ lastTwo [1]; Now you have all parameters in the form of array and you can process it.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -