T
T
topuserman2021-07-20 14:49:14
htaccess
topuserman, 2021-07-20 14:49:14

How to make a url address synonym by mask?

How can I make a url-address synonym by mask, for example:

/catalog/dir1/dirn/../item/1/ - default product page url

as in htaccess to /catalog/dir1/dirn/../ item/1/ - was the same section available as /catalog/dir1/dirn/../product/1/ ?

so that you do not have to rewrite the logic, or the application's routing. Is it possible to solve this purely in .htaccess?

UPD: I wrote the following rule:

RewriteRule ^(\/catalog.*)\/item\/(.*) /$1/product/$2 [L,R=301] - the redirect is correct. And how to do the same without a redirect? remove [L,R=301] - throws on 404 page...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Page-Audit.ru, 2021-07-20
@PageAuditRU

What if it's like this?
RewriteRule ^\/(catalog.*)\/item\/(.*) /$1/product/$2 [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question