Answer the question
In order to leave comments, you need to log in
How can you defeat such broken links?
Hello
It suddenly turned out that on the site (modx) broken links like
http:/www.site.ru/db.php?j=61&q=689&c=5
http:/www.site.ru/db.php? j=67&s=55&c=5
http:/www.site.ru/db.php?j=45&q=9691&c=5
..
The reason is db.php is a self-written crutch that forms the database of visitors and customers for the site by ip.
Why, xs.
Is it possible to defeat such a disgrace with a redirect?
For example, by making a redirect from these links to www.site.ru.
RewriteRule ^db.php?(.*)$ http://www.site.ru [L,R=301]
(that's correct, by the way?) Answer the question
In order to leave comments, you need to log in
no, everything after the question is GET
you need "how to make a redirect with a get parameter"
Or like this
# 301 --- http://site.ru/cat1/cat2/art.htm?fb_comment_id=12345&start=2 => http://site.ru/cat1/cat2/article.html?start=2
RewriteCond %{QUERY_STRING} (^|&)fb_comment_id\=12345($|&)
RewriteCond %{QUERY_STRING} (^|&)start\=2 ($|&)
RewriteRule ^cat1/cat2/art\.htm$ /cat1/cat2/article.html?start=2 [L,R=301]
no, everything after the question is GET
you need "how to make a redirect with a get parameter"
RewriteCond %{QUERY_STRING} j=(\d+) [NC]
RewriteCond %{QUERY_STRING} q=(\d+) [NC]
RewriteRule .* http://www.site.ru/? [R=301,L]
RewriteRule ^db.php$ http://www.site.ru [L,R=301]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question