B
B
bormor2016-05-02 11:49:35
PHP
bormor, 2016-05-02 11:49:35

Redirect 301 for an address containing a POST request - how can I do it?

I'm trying to make a 301 redirect from
site-name.ru/akcii-i-novinki.php?id_news=18
to
site-name.ru/korrect-face.php The
traditional solution

Redirect 301 /akcii-i-novinki.php?id_news=18 http://site-name.ru/korrect-face.php

does not work
As far as I understand the problem is in these lines of settings in .htacess. Perhaps I'm wrong.
RewriteRule ^articles/([^/]+)/?$ stati_art.php?id_public=$1
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/

Full .htacess code
AddDefaultCharset UTF-8
ErrorDocument 404 /404.php
#php_value error_reporting 7
#php_value session.save_path "/tmp"

#Options +FollowSymLinks
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} ^www.site-name.ru
RewriteRule (.*) http://site-name.ru/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://site-name.ru/ [R=301,L]


RewriteRule ^articles/([^/]+)/?$ stati_art.php?id_public=$1
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/


Redirect 301 /akcii-i-novinki.php?id_news=18 http://site-name.ru/korrect-face.php
Redirect 301 /test http://site-name.ru/korrect-face.php

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton B, 2016-05-02
@bigton

In order for the browser to send the post data to the redirect address, it is necessary to return not a 301, but a 307 header.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question