For your rewrite URL. You can use following .htaccess
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/(index.php)?$
RewriteCond %{REQUEST_URI} !^/details.php$
RewriteRule ^(.*)$ /details.php?domain=$1 [QSA,L]
It will rewrite http://www.mydomain.com/test123.com
to http://www.mydomain.com/details.php?domain=test123.com