Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Replace %23 with # in URL

Solved by Vitaly Harisov View solution

Started by Vitaly Harisov 2 years ago · 3 replies · 237 views
2 years ago

I'm trying to setup Grav to replace %23 in page URL with #

e.g. redirect from page like this
https://voyahchat.ru/common/account%23ios

to this
https://voyahchat.ru/common/account#ios

I edited .htaccess file and added line

RewriteRule ^(.*)(%23)(.*)$ $1\x23$3 [NE,R=301,L]

or line

RewriteRule ^(.*)?%23(.*)?$ $1#$2 [NE,R=301,L,B]

but with no luck, I'm getting 404 error.

Is .htaccess can process URLs in such way?

Or may be I can achieve this functionality editing some GRAV file?

last edited 08/06/24 by Vitaly Harisov
2 years ago

IMO this shouldn't be handled on target website, but rather on the source, where such URL is constructed 🤷‍♂️

2 years ago

I can't fix broken Telegram clients, but I can replace this on the side of my site, so I do.

👍 1

Suggested topics

Topic Participants Replies Views Activity
General · by Andy Miller, 7 days ago
0 117 7 days ago
General · by lynbor, 1 month ago
3 445 2 weeks ago
General · by lynbor, 3 weeks ago
7 564 2 weeks ago
General · by Harry, 2 weeks ago
0 165 2 weeks ago
General · by Old Man Umby, 1 month ago
2 310 4 weeks ago