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

Member

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

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

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

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

Related Threads:

How to rewrite http get request with .htaccess?
How to exclude a directory from .htaccess rewrite?
How to redirect urls with blank space in .htaccess?
How to rewrite a php script to javascript?
How to rewrite seo url in magento?
How to rewrite css rules on tailwind css?