URL white spaces removal in htaccess

by Francis 2014-04-03 16:00:39

URL white spaces remover in htaccess


# remove spaces from start or after / in URL
RewriteRule ^(.*/|)[s]+(.+)$ $1$2 [L]

# remove spaces from end or before / in URL
RewriteRule ^(.+?)[s]+(/.*|)$ $1$2 [L]

# replace spaces by - in between the URL
RewriteRule ^([^s%20]*)(?:s|%20)+(.*)$ $1-$2 [L,R]

783
like
0
dislike
0
mail
flag

You must LOGIN to add comments