Get exclusive CAP network offers from top brands

View CAP Offers

Reply To: One or More Website

[bsa_pro_ad_space id=2]
#674419
Anonymous
Inactive

Another option is sub-domains off of your main domain if your web host supports “wildcard DNS”. This is an option that when enabled sends all web requests for *.mycasinosite.com to http://www.mycasinosite.com. So for example you could have blackjack.mycasinosite.com, roulette.mycasinosite.com or what have you. This could also be a good way to get your search terms in the domain without buying a bunch of new domains.

To do this you have to ask your host to enable Wildcard DNS for your domain and your domain has to have a static IP address. Sometimes you can set the option yourself; PHPwebhosting for example has Wildcard as an option in their control panel.

Then, you need to make a .htaccess file in your web document root directory, containing the following (or adding to it if .htaccess is already there)

RewriteEngine on

# redirect if no sub-domain
RewriteCond %{HTTP_HOST} ^([^.]+).([^.]+)$ [NC]
RewriteRule ^(.*)$ http://www.%1.%2/$1 [R,L]

# redirect domains
RewriteCond %{REQUEST_URI} !^/sites
RewriteCond %{HTTP_HOST} ^([^.]*).?([^.]+).([^.]+)$ [NC]
RewriteRule ^(.*)$ /sites/%3/%2/%1/$1

# fix trailing slash
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [L]

The first rule directs to the www sub-domain if there’s no subdomain specified. The second kicks in if there is a subdomain and looks along a content path with a specific format, which is “sites/TLD/domain/sub-domain/” within the document root. So for example, the content for http://blackjack.mycasinosite.com/ would be be found in sites/com/mycasinosite/blackjack/. The last rule adds a trailing slash if it’s missing. The com/mycasino site part is just included so you see how the .htaccess rule gets the subdomain. You can take it out;

RewriteRule ^(.*)$ /sites/%1/$1

would make http://blackjack.mycasinosite.com/ be found in sites/blackjack from your document root.