Answer the question
In order to leave comments, you need to log in
How to set up the CNC without taking into account the directory?
Hello, there are addresses
site.ru/category1/?pages=top
site.ru/category2/?pages=top
site.ru/category3/?pages=top
etc.
How to turn it into a link of this type
site.ru/category1/link/top.html
site.ru/category2/link/top.html
site.ru/category3/link/top.html
If you do this in htaccess:
RewriteRule ^category1/link/([^/]*).html$ category1/?pages=$1 [L]
RewriteRule ^category2/link/([^/]*).html$ category2/?pages=$1 [L]
RewriteRule ^category3/link/([^/]*).html$ category3/?pages=$1 [L]
RewriteRule ^link/([^/]*).html$ ?pages=$1 [L]
Answer the question
In order to leave comments, you need to log in
RewriteRule ^category(\d+)/link/([^/]*).html$ category$1/?pages=$2 [L]
Use a software router.
As an example -
https://github.com/nikic/FastRoute
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question