E
E
Evgeniy2022-02-01 19:59:18
htaccess
Evgeniy, 2022-02-01 19:59:18

How to redirect all nested posts of one category to the main page?

Good afternoon

The site on WP caught a virus or whatever, but now pages from "Casino" appear in the search. There are no
static pages in the site folders, they are generated by some kind of script that

looks like this:

.

There is no category "news" at all

1)
Maybe someone met with something similar?
It's not clear where to look and where to dig
I checked for viruses through Beget, there are a lot of missing files due to weight, there is nothing unusual

2)
How can I redirect all posts that come after /news/
to the main page of the site in .htaccess?

Please tell me how to spell

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Karabanov, 2022-02-01
@karabanov

If a

There is no "news" category at all

Then
For Nginx
location /news {
   return 301 /;
}

For Apache
RewriteEngine on
RewriteRule "^/news/(.*)"  "/"  [R,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question