Apache 2.4 RewriteRule con ancoraggio non reindirizzato correttamente

Problema

Riscrivi le regole sul server web Apache 2.4 che tentano di reindirizzare a URL con ancoraggi non vengono reindirizzati correttamente.  Esempio:

RewriteRule ^/test.html /test.html#anchor [R=301,L]

Ambiente

Modulo AEM Dispatcher installato in Apache HTTP Server 2.4

Risoluzione

Per evitare di codificare il carattere #, aggiungere il flag NE alle regole di riscrittura:

RewriteRule ^/test.html /test.html#anchor [NE,R=301,L]

Logo Adobe

Accedi al tuo account