Redirect referrer domain

What’s the best way to redirect hits from a specific domain? Are there any actions that can do this?


freewaytalk mailing list
email@hidden
Update your subscriptions at:

No Actions, but you can do this pretty easily with Apache .htaccess directives. When you say “from a specific domain”, do you mean when people from a certain domain visit your site, or do you mean when a request comes in to your server for a specific domain (assuming you host more than one domain on that one server)?

Walter

On Jun 28, 2019, at 3:14 PM, grantsymon email@hidden wrote:

What’s the best way to redirect hits from a specific domain? Are there any actions that can do this?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
Information for existing FreewayTalk / Groups.io users - Site Feedback - Softpress Talk


freewaytalk mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options

Hi Walter,

thanks for the reply.

The first (‘when people from a certain domain visit your site’).

When someone visits my site from a specific domain, in this case, pinterest, I’d like to automagically direct them to either a specific site or page of my own, or even a specific domain of my own.


freewaytalk mailing list
email@hidden
Update your subscriptions at:

You could try this:

<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteCond %{HTTP_REFERER} ^https?://(www)?.*pinterest\.com.*$  [NC]
 RewriteRule ^(.*)$ https://some.other.site/$1 [R,L]
</IfModule>

In an .htaccess file. If your host permits an .htaccess file to modify this type of configuration directive, and mod_rewrite is on, you will be all set. If either of those are not true, you can ask your host to enable them, or look in your cPanel to see if they are available to be turned on.

That redirect takes care to send along whatever was after the / to the server you’re redirecting to. You can leave off the $1 if you don’t want to do that.

Walter

On Jun 29, 2019, at 4:02 AM, grantsymon email@hidden wrote:

Hi Walter,

thanks for the reply.

The first (‘when people from a certain domain visit your site’).

When someone visits my site from a specific domain, in this case, pinterest, I’d like to automagically direct them to either a specific site or page of my own, or even a specific domain of my own.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
Information for existing FreewayTalk / Groups.io users - Site Feedback - Softpress Talk


freewaytalk mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options

Thanks Walter!!

I have used htaccess in the past, so it should work fine. I’ll try it this week … just have to work out how to test it. :slight_smile: :slight_smile: :slight_smile:


freewaytalk mailing list
email@hidden
Update your subscriptions at:

You can use curl in Terminal to provide a pretend referer, e.g. something
like:
curl --referer http://pinterest.com/ireallycamefrompinteresthonest
http://your.test.site/something

That’ll spit whatever the server gives back on to Terminal so redirecting
to a simple text file(s) rather than full-blown page(s) with lots of HTML
will make verifying where you landed less painful.

On Sun, Jun 30, 2019 at 7:25 PM grantsymon email@hidden wrote:

Thanks Walter!!

I have used htaccess in the past, so it should work fine. I’ll try it
this week … just have to work out how to test it. :slight_smile: :slight_smile: :slight_smile:


freewaytalk mailing list
email@hidden
Update your subscriptions at:
Information for existing FreewayTalk / Groups.io users - Site Feedback - Softpress Talk


freewaytalk mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options

Good Idea, Simon! Eva, just a warning if you paid attention in grammar school: don’t spell referrer the usual way, only use one r in the middle, because long ago when they were coming up with these header names, someone wasn’t a good speller, and it stuck.

Walter

On Jul 1, 2019, at 6:28 AM, Simon Manning email@hidden wrote:

You can use curl in Terminal to provide a pretend referer, e.g. something
like:
curl --referer http://pinterest.com/ireallycamefrompinteresthonest
http://your.test.site/something

That’ll spit whatever the server gives back on to Terminal so redirecting
to a simple text file(s) rather than full-blown page(s) with lots of HTML
will make verifying where you landed less painful.

On Sun, Jun 30, 2019 at 7:25 PM grantsymon email@hidden wrote:

Thanks Walter!!

I have used htaccess in the past, so it should work fine. I’ll try it
this week … just have to work out how to test it. :slight_smile: :slight_smile: :slight_smile:


freewaytalk mailing list
email@hidden
Update your subscriptions at:
Information for existing FreewayTalk / Groups.io users - Site Feedback - Softpress Talk


freewaytalk mailing list
email@hidden
Update your subscriptions at:
Information for existing FreewayTalk / Groups.io users - Site Feedback - Softpress Talk


freewaytalk mailing list
email@hidden
Update your subscriptions at:
https://freewaytalk.softpress.com/person/options