Answer the question
In order to leave comments, you need to log in
How to set exclusions in .htaccess?
Given:
1) Website - domen.ru
2) domen.ru/ products /name_category/ - leads to the products.php file and the store category is processed
3) RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond % {REQUEST_URI} !\..{1,10}$
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^products/(.+[^/])/(.+[^/])/?$ products .php?category[]=$1&category[]=$2 [L,NC,QSA]
RewriteRule ^products/(.+[^/])/?$ products.php?category[]=$1 [L,NC,QSA ]
Goal:
1) Remove products from url
I wanted to make a link like domen.ru/category/ immediately lead to the processing file. And make other pages the usual exceptions, for example, domen.ru/contacts/ (to lead to contacts.php).
I wrote this rule:
RewriteRule ^(.+[^/])/?$ products.php?category[]=$1 [L,NC,QSA]
And for exceptions:
RewriteRule ^contacts/?$ contacts.php [L,NC ]
But now all pages follow this rule: RewriteRule ^(.+[^/])/?$ products.php?category[]=$1 [L,NC,QSA]
Swapped rows, but doesn't help. Tell me what can be done. Thanks in advance.
Answer the question
In order to leave comments, you need to log in
Everything is simple
here 1. Add an exception you already know how to do it! in RewriteCond
so add another cond
конд
конд
конд
конд
что делать
RewriteCond %{REQUEST_URI} (скобка первая) ляляля ( скобка вторая)
RewriteRule .* %1%2
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question