Q:

htaccess - adding prefix to new url

how am I suppose to add a prefix to new url?
RewriteEngine on

RewriteRule ^(.*) http://localhost/redirect/s_$1 [R=301,L]

I want it to redirect to new url with s_ prefix example s_about.html
but it it redirects me to this
   http://localhost/redirect/s_s_s_s_s_s_s_s_s_s_s_s_s_s_s_s_s_s_s_s_s_index.html

A:

Try with below rule we are skipping urls which have s_ prefix.
RewriteEngine on

RewriteRule ^\b(?!s_)(\w+)$ http://localhost/redirect/s_$1 [R=301,L]

