I
I
icell762021-02-03 16:43:56
Apache HTTP Server
icell76, 2021-02-03 16:43:56

How to create an htaccess redirect?

Good afternoon. We have a website. There is an index.php page. For some reason, Yandex began to index non-existent pages, for example "/index.php/2020/05/12/hello-world/". If you go to it, then a crooked page without styles will come out. How to redirect to the main page? Help me please.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
dodo512, 2021-02-03
@icell76

If you need a redirect /index.php/page/to/page/

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

If /index.php/page/on/
RewriteCond %{THE_REQUEST} " /index\.php/" 
RewriteRule ^  https://site.ru/ [R=301,L,NE]

M
Maxim Egorichev, 2017-08-10
@MaksimEgorichev

What application do you want to create?
If applications are for auto-posting to a group, then no, no contracts need to be concluded.

S
Sergey Ivanovsky, 2017-08-24
@S84

If the application is non-commercial without payments, then an offer is used there (excluding non-residents). If the application will use payment instruments, contracts will be required.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question