Here is what I recommend.
1) Create an additional domain (s.thecompanyiworkfor.com). The manager will be easier to manage, and you will avoid conflict with .htaccess, because this folder is separated from the main WWW folder.
eg:
s.thecompanyiworkfor.com => /home/thecompanyiworkfor.com/s_public_html/ www.thecompanyiworkfor.com => /home/thecompanyiworkfor.com/public_html/
2) Use this .htaccess in /home/thecompanyiworkfor.com/s_public_html/
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !^index\.php RewriteRule ^([a-z0-9\-]+)(\/?)$ index.php?code=$1 [L,NC,QSA]
Then in /home/thecompanyiworkfor.com/s_public_html/index.php you can check which code matches the url and redirect. If not found, redirect to www.thecompanyiworkfor.com
Book of zeus
source share