POU infinity



  • Tell me how to put the chip right. There is an addin where the user can create categories of goods + category 1 + category, etc.

    For example, the line will: my-site.ru/index.php?review=shopcat=appliance devicesv-cat=kitchenb-cat=redmond-rmc-pm330

    I' into the browser:

    my-site.ru/shop/appliance/kitchen/redmond-rmc-pm330/

    In file .htaccess:

    RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/$ index.php?review=$1&cat=$2&v-cat=$3&b-cat=$4[QSA,L]
    RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/$ index.php?review=$1&cat=$2&v-cat=$3
    RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/$ index.php?review=$1&cat=$2
    RewriteRule ^([A-Za-z0-9-]+)/$ index.php?review=$1
    

    How can it be correct to write in .htaccess? so there may be no more than 2 or 3 categories, for example, 10, and the following line will not be so far as it is:

    RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/$ index.php?review=$1&cat=$2&v-cat=$3&b-cat=$4&n-cat=$5[QSA,L]
    

    Maybe there's a simple solution, isn't that what everyone does?



  • Normally, such parameters do not process at the mod_rewrite level, but send all requests for one entry point

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^index.php [L]
    

    They're writing a rolling that extracts from the variable. $_SERVER['QUERY_STRING'] The contents of the requested line shall calculate the level of investment of the catalogues and, depending on this, the page shall be taken.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2