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

Member

by dedrick , in category: Third Party Scripts , a month ago

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

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by adan , a month 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.