Basically, my client wants to make new visitors enter the site I'm working on through the splash page. Unfortunately, Google indexed the home page. So no one ever actually sees the splash page. Is there a way that I can make a .htaccess file create a cookie in the viewers browser that says "I'm not new" (or maybe showsplash=false
). Then the .htaccess could check if the cookie exists, and if not, load the splash page. Here's my code:
Options +FollowSymLinks
RewriteEngine on
# Redirect to the splash page if new visitor
RewriteCond %{HTTP_COOKIE} !^.*show_splash=false.*$ [NC,R]
RewriteRule .* %{HTTP_HOST}
# If it's a new visitor, set the cookie
RewriteCond %{HTTP_COOKIE} !^.*show_splash=false.*$ [NC]
RewriteRule .* - [CO=show_splash:false:%{HTTP_HOST}]
I'm not convinced that this is either right or efficient. Anyone know how it should be done?