Use htaccess to remove any sub directories in URL

Oh I see I have a space there that shouldn’t be there.

How about

RewriteCond %{HTTP_HOST} !^www\.example\.com$ [nc]
RewriteRule .? http://www.example.com%{REQUEST_URI} [L,R=301]

Which is pretty much the best of both worlds of mine and @dklynn 's solutions :slight_smile: