K
K
Kirill Gorelov2021-07-22 15:01:01
htaccess
Kirill Gorelov, 2021-07-22 15:01:01

Yandex web master found a link, how can I delete it now via htaccess?

Yandex webmaster finds links like
/index.php/about
/index.php/price/73-mont
/index.php/news/351-2017-05-04-06-15-48
/index.php/zamer/
/index .php/articles/64-2010-03-04-06-32-16
/index.php/news/281-2017-01-13-09-02-54
/index.php/news
/index.php/news /329--12590
/index.php/instructions

But we don't have such links.
The engine is self-written and a bunch of sites are already working on it, that is, the engine has been time-tested.
Because we don’t know where Yandex takes them from and we don’t have such links, then we want to cut such links through htaccess.

Before:
/index.php/news/329--12590
/index.php/instructions

Now
/news/329--12590
/instructions

But we don't know how to cut it. Tell me please ....

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2021-07-22
@dodo512

Add to the beginning of the file

RewriteEngine on

RewriteCond %{THE_REQUEST} " /index\.php/?(\S*)"
RewriteRule ^ /%1 [R=301,L,NE]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question