I want the links to be of this type: site.ru/xxx/ site.ru/xxx/xxx/ site.ru/xxx/xxx/xxx/, etc. It is necessary in htacces rule, not to prescribe a redirect for each page.
1 answer
Lord, redirect all requests to the main one, and then parse this URL, write a class that will deal with it. For redirecting nginx (right in the config in location \ -
if (!-f $request_filename) {rewrite ^(.*)$ /index.php;} (well, this is if you have PHP, if something else, I think you know what to do =) For .htaccess - for
Options -IndexesRewriteEngine OnRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule ^(.*)$ index.php [L,QSA] (and of course mod_rewrite On)
|