A
A
amanzhula2018-07-08 21:26:48
htaccess
amanzhula, 2018-07-08 21:26:48

How to keep # character in htaccess redirect?

Please help me to make a correct redirect from one domain to another, keeping the # character in the end.
htaccess looks like this:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^old-site\.ru$ [NC]
RewriteRule ^(.*)$ http://new-site.ru/#/cat/news/$1 [R=301,L]

The problem is that the # character is not stored after the redirect, and this leads to an error.
the # symbol is replaced with %23 and the link becomes http://new-site.ru/%23/cat/news/
How to keep the # symbol when redirecting? Thanks to.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DevMan, 2018-07-08
@amanzhula

https://httpd.apache.org/docs/2.4/rewrite/flags.ht...

P
pilotus, 2018-07-08
@pilotus

Have you tried adding AddDefaultCharset?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question