Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Replace %23 with # in URL

Solved by Vitaly Harisov View solution

Started by Vitaly Harisov 2 years ago · 3 replies · 354 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 themetman, 24 hours ago
2 41 17 hours ago
General · by Hanns Mattes, 1 week ago
0 121 1 week ago
General · by Karmalakas, 1 week ago
2 185 1 week ago
General · by Hanns Mattes, 3 weeks ago
0 235 3 weeks ago
General · by Dima, 4 weeks ago
1 211 4 weeks ago