In the .htaccess example below, if someone types in a URL like the following...
http://mysite.com/ricks-motorcycles
...it will automatically load the page from x
You can qualify your rewrites with a RewriteCond
:
RewriteEngine On
RewriteCond %{HTTPS} =on
RewriteRule ^ricks-motorcycles/(.*)$ https://example.com/ricks-motorcycles/$1 [P,L]
RewriteCond %{HTTP_HOST} =ricks-motorcycles.mysite.com
RewriteRule ^(.*)$ http://example.com/ricks-motorcycles/$1 [P,L]
For more information, see the mod_rewrite documentation.