How to rewrite url-encoded-base64 with .htaccess?

by percy_bauch , in category: SEO , 7 months ago

How to rewrite url-encoded-base64 with .htaccess?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

by larry_orn , 7 months ago


To rewrite a URL encoded base64 encoded string using .htaccess, you can use the RewriteRule directive. Here's an example:

RewriteEngine On
RewriteRule ^decoded/(.*)$ /?param=$1 [L]

In this example, the RewriteEngine directive enables URL rewriting. The RewriteRule directive matches the given based64 encoded string after the /decoded/ part of the URL. It then captures the encoded string as $1 and appends it to the ?param= query string in the new rewritten URL.

For example, if you have a URL like, it will be internally rewritten to

Note: This rewrite rule assumes that the encoded string does not contain any slashes (/) or characters that are not allowed in a URL. If your encoded string contains such characters, you may need to adjust the regular expression pattern in the RewriteRule directive accordingly.