I
I
Insom842019-12-10 16:58:16
URL Handling
Insom84, 2019-12-10 16:58:16

How can I redirect these links?

The site has links like this:

https://site.ru/index.php?route=bossblog/article&blog_article_id=1 
https://site.ru/blog/1

how to implement a redirect?
this construction does not work (some kind of looping occurs):
RewriteCond %{QUERY_STRING} (^|&)route\=bossblog/article($|&)
RewriteCond %{QUERY_STRING} (^|&)blog_article_id\=1($|&)
RewriteRule ^index\.php$ /blog/1? [L,R=301]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-12-10
@Insom84

RewriteCond %{THE_REQUEST} ^\S+\s+/index\.php\?(?=(|.*?&)route=bossblog/article[&\s])(?=(|.*?&)blog_article_id=1[&\s])
RewriteRule ^ https://site.ru/blog/1? [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question