Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Replace %23 with # in URL

Solved by Vitaly Harisov View solution

Started by Vitaly Harisov 2 years ago · 3 replies · 79 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 Jerry Hunt, 4 days ago
2 99 16 hours ago
General · by pamtbaau, 21 hours ago
1 63 21 hours ago
General · by Andy Miller, 1 day ago
0 48 1 day ago
General · by Marcel, 12 months ago
6 357 5 days ago
General · by Duc , 6 days ago
3 45 6 days ago