I'm using a 301 redirect on my htaccess file. I was wondering if it's possible to redirect users only on their first access and then show the site normally with a rewrite condition or something similar.
thank you!
I'm using a 301 redirect on my htaccess file. I was wondering if it's possible to redirect users only on their first access and then show the site normally with a rewrite condition or something similar.
thank you!
Based on your comment response, the best bet would be doing this in your page code instead of trying to use Apache to do it for you.
You could identify "new" users a couple of ways:
You can display your welcome page a couple of ways too:
(It's worth noting that even if a user has cookies disabled, you should still be able to set a session so the welcome message doesn't appear on every page. The user may get it again on later visits, but if it's worked in the design well enough that shouldn't be a big deal.)
Header set Set-Cookie "visited=true" RewriteEngine On RewriteBase / RewriteCond %{HTTP_COOKIE} !^visited=true$ [NC] RewriteRule .? /welcome.html [R=301,NC,L]
This still redirect all users!
There's no real good way to do this as you need to track users, and people more and more try to avoid that. If you insist, you could always set a cookie on the first visit then check for that cookie's existence afterwards.