How to rewrite a space (%20) in .htaccess?

Member

by dedrick , in category: Third Party Scripts , 4 months ago

How to rewrite a space (%20) in .htaccess?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by adan , 3 months ago

@dedrick 

To rewrite a space (%20) in .htaccess, you can use the following RewriteRule:


RewriteRule "^([^ ]) (.)$" /$1%20$2 [N]


This rule will match any URL with a space in it and replace the space with %20. Make sure to place this rule in your .htaccess file within the root directory of your website.