Skip to content
Advertisement

how do i allow space in regex in mod_rewrite engine

i have a regex that i want it to allow white spaces. this regex i am using is in the .htaccess file. whenever i put the s it makes the whole regex not work

what can i do to make it allow white spaces and work?

this is my regex:

JavaScript

this is my full rewrite rule, when i put s it doesn’t work

Advertisement

Answer

Have your rule like this:

JavaScript

Here [^/] is negated character class that matches any character except / and it will match whitespace as well.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement