F
F
frie6662021-07-03 20:24:10
Regular Expressions
frie666, 2021-07-03 20:24:10

How to create a rule for .htaccess?

I want my urls to be like this
https://site.ru/catalog/categoryname/subcategoryname
https://site.ru/catalog/categoryname/subcategoryna... I

wrote this
RewriteRule ^catalog/([a-zA-Z0 -9-/]+)$/page/([0-9])$ catalog.php?url=$1&page=$2 [L]

but it doesn't want to work

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2021-07-03
@frie666

RewriteRule ^catalog/(.+)/page/([0-9]+)$ catalog.php?url=$1&page=$2 [L]
RewriteRule ^catalog/(.+)$ catalog.php?url=$1 [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question