Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

apache2 2.4.56-1 redirects not normal working appeared %3f

0 views
Skip to first unread message

alex

unread,
Mar 21, 2023, 6:40:04 AM3/21/23
to
Package: apache2
Version: 2.4.56-1


Hello.
I used to redirect
RewriteRule ^test\.php$ https://www.test.com/? [R=301,L]

Result
test.com/test.php 301 > https://www.test.com/


After upgrading to the 2.4.56-1
Result
test.com/test.php 301 > https://www.test.com/%3f

What is the problem can you fix it?

Hleb Valoshka

unread,
Mar 21, 2023, 8:00:04 AM3/21/23
to
On 3/21/23, alex <pai...@gmail.com> wrote:
> Package: apache2
> Version: 2.4.56-1

Wrong list.

Pavel Ammosov

unread,
Mar 21, 2023, 7:10:04 PM3/21/23
to
On Tue, Mar 21, 2023 at 01:15:08PM +0300, alex wrote:
> RewriteRule ^test\.php$ https://www.test.com/? [R=301,L]
> After upgrading to the 2.4.56-1
> Result
> test.com/test.php 301 > https://www.test.com/%3f

Действительно, после обновления apache2 в bullseye такой редирект стал экранировать вопросительный знак
в новом URL. Но есть и хорошие новости, в старом apache2 (2.4.54-1~deb11u1) знак вопроса просто исчезал:

| curl -v http://localhost:1289/test.php
| * Connected to localhost (::1) port 1289 (#0)
| > GET /test.php HTTP/1.1
| [...]
| >
| < HTTP/1.1 301 Moved Permanently
| < Server: Apache/2.4.54 (Debian)
| < Location: http://example.com/
| ^^^

т.е. можно просто убрать этот вопрос. А если он использовался для удаления параметров URL из нового адреса,
то просто добавить флаг QSD (https://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_qsd):

RewriteRule ^test\.php$ https://www.test.com/ [R=301,L,QSD]
0 new messages