M
M
Mark2017-06-19 07:25:48
htaccess
Mark, 2017-06-19 07:25:48

How to shorten links?

How can I shorten a link using htaccess?
Now: site.ru/index.php?page=catalog&cat=2499 Required
: site.ru/catalog/2499

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2017-06-19
@shambler81

This is the url with the get request, the get is not part of the request_uri so it is managed separately.

RewriteCond %{QUERY_STRING} (^|&)page\=catalog($|&)
RewriteCond %{QUERY_STRING} (^|&)cat\=2499($|&)
RewriteRule ^index\.php$ /catalog/2499? [L,R=301]

The question at the end will remove the get parameter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question