I need to redirect traffic to a URL based on it's originating URL.
· siteabc.co.uk domain will redirect to sitexyz.co.uk/camps
· siteabc.co.uk/daycamps will also exist
What I would like to happen is if a customer types in siteabc.co.uk they will be redirected to sitexyz.co.uk/camps where a pop up/lightbox will come up to say ‘Are you looking for Daycamps?’ if clicked the user will be taken to siteabc.co.uk/daycamps
If they land directly on sitexyz.co.uk/camps the pop up should not be shown.
I need the lightbox to only be shown if they have arrived from siteabc.co.uk, is this possible?
I'm thinking jQuery should be able to do it, but I'm not sure if there is a starting point to use. Any help appreciated.
If you are working on any Apache Web server then the solution to your problem is to use .htaccess file. htaccess files(distributed configuration files) provide a way to make configuration changes on a per-directory basis.
First create a file with name .htaccess and keep it in the root directory. in your case at siteabc.co.uk/.htaccess
Because different versions of Apache server the configuration file syntax may changes, here are the codes that should work
Type: 1
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !siteabc.co.uk/$ [NC]
RewriteRule ^(.*)$ siteabc.co.uk/camps/$1 [L,R=301]
Type: 2
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/$
RewriteRule (.*) siteabc.co.uk/camps [R=301,L]
Type: 3
RewriteEngine On
RewriteRule ^$ /camps [L]
Thanks