Mailing List Archive

Controlling access to web site based on domain name
We would like to control access to a web site based on a listed domain and redirect any accesses from domains not
listed to a particular web page.

We need to be able to use the domain names and not IP addresses.

Is this something we should be able to do within .htaccess and using Rewrite for the redirect or do we need to use something else?

Thanks
Re: Controlling access to web site based on domain name [ In reply to ]
Have you looked into virtual hosts configurations?

https://httpd.apache.org/docs/2.4/vhosts/examples.html

On Fri, Dec 16, 2022 at 4:01 PM Rose, John B <jbrose@utk.edu.invalid> wrote:

> We would like to control access to a web site based on a listed domain and
> redirect any accesses from domains not
> listed to a particular web page.
>
> We need to be able to use the domain names and not IP addresses.
>
> Is this something we should be able to do within .htaccess and using
> Rewrite for the redirect or do we need to use something else?
>
> Thanks
>
>
>

--
Thanks,
Brian Wolfe
https://www.linkedin.com/in/brian-wolfe-3136425a/
RE: Controlling access to web site based on domain name [ In reply to ]
Brian beat me to it. Set up virtual hosts with the desired domain listed and the default (what someone will get if they access via IP) goes to your desired "wrong way to get here" page.

Jim




-----Original Message-----
From: "Rose, John B" <jbrose@utk.edu.INVALID>
Sent: Friday, December 16, 2022 13:00
To: "users@httpd.apache.org" <users@httpd.apache.org>
Subject: [users@httpd] Controlling access to web site based on domain name

We would like to control access to a web site based on a listed domain and redirect any accesses from domains not
listed to a particular web page.

We need to be able to use the domain names and not IP addresses.

Is this something we should be able to do within .htaccess and using Rewrite for the redirect or do we need to use something else?

Thanks





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Controlling access to web site based on domain name [ In reply to ]
Brain

Thanks for replying.

I think I may not have worded my question clearly...'

If I have web site ...
mysite.abc.com

In the htaccess on that page I put something like ... Require def.com

And I want users from a link on the page somesite.def.com to be able to access mysite.abc.com by clicking on that link

But I dont want anyone from a link on a site named somesite.xyz.com to be able to access the homepaage on mysite.abc.com. I want to redirect them to mysite.abc.com/info.html

So any domain not explicitly listed in htaccess file will get redirected.


________________________________
From: Brian Wolfe <wolfebrian2120@gmail.com>
Sent: Friday, December 16, 2022 4:08 PM
To: jbrose@utk.edu.invalid <jbrose@utk.edu.invalid>
Cc: users@httpd.apache.org <users@httpd.apache.org>
Subject: Re: [users@httpd] Controlling access to web site based on domain name

You don't often get email from wolfebrian2120@gmail.com. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
Have you looked into virtual hosts configurations?

https://httpd.apache.org/docs/2.4/vhosts/examples.html<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fhttpd.apache.org%2Fdocs%2F2.4%2Fvhosts%2Fexamples.html&data=05%7C01%7Cjbrose%40utk.edu%7C8c53f584788a4c5ffd3108dadfa9c6ce%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068217538638429%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2FRKjCoB6a%2Fr5D8m9NzJUgpHn7nXv9n1zPpQFV68Wzz8%3D&reserved=0>

On Fri, Dec 16, 2022 at 4:01 PM Rose, John B <jbrose@utk.edu.invalid> wrote:
We would like to control access to a web site based on a listed domain and redirect any accesses from domains not
listed to a particular web page.

We need to be able to use the domain names and not IP addresses.

Is this something we should be able to do within .htaccess and using Rewrite for the redirect or do we need to use something else?

Thanks




--
Thanks,
Brian Wolfe
https://www.linkedin.com/in/brian-wolfe-3136425a/<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.linkedin.com%2Fin%2Fbrian-wolfe-3136425a%2F&data=05%7C01%7Cjbrose%40utk.edu%7C8c53f584788a4c5ffd3108dadfa9c6ce%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068217538638429%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Vymgo6BPWgHQmHjYfLGxTQJiMIDyuI1Z3JgwSnNT0jM%3D&reserved=0>
Re: Controlling access to web site based on domain name [ In reply to ]
You're referring to controlling access via the referrer, which is trivial
to spoof; I strongly recommend not using that approach.

The other concept to understand here is that you can require the traffic to
match a certain rDNS value.

If you still want to match the referrer, you can do so with <If, expr or a
RewriteCond.


On Fri, Dec 16, 2022 at 4:28 PM Rose, John B <jbrose@utk.edu.invalid> wrote:

> Brain
>
> Thanks for replying.
>
> I think I may not have worded my question clearly...'
>
> If I have web site ...
> mysite.abc.com
>
> In the htaccess on that page I put something like ... Require def.com
>
> And I want users from a link on the page somesite.def.com to be able to
> access mysite.abc.com by clicking on that link
>
> But I dont want anyone from a link on a site named somesite.xyz.com to be
> able to access the homepaage on mysite.abc.com. I want to redirect them
> to mysite.abc.com/info.html
>
> So any domain not explicitly listed in htaccess file will get redirected.
>
>
> ------------------------------
> *From:* Brian Wolfe <wolfebrian2120@gmail.com>
> *Sent:* Friday, December 16, 2022 4:08 PM
> *To:* jbrose@utk.edu.invalid <jbrose@utk.edu.invalid>
> *Cc:* users@httpd.apache.org <users@httpd.apache.org>
> *Subject:* Re: [users@httpd] Controlling access to web site based on
> domain name
>
> You don't often get email from wolfebrian2120@gmail.com. Learn why this
> is important <https://aka.ms/LearnAboutSenderIdentification>
> Have you looked into virtual hosts configurations?
>
> https://httpd.apache.org/docs/2.4/vhosts/examples.html
> <https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fhttpd.apache.org%2Fdocs%2F2.4%2Fvhosts%2Fexamples.html&data=05%7C01%7Cjbrose%40utk.edu%7C8c53f584788a4c5ffd3108dadfa9c6ce%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068217538638429%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2FRKjCoB6a%2Fr5D8m9NzJUgpHn7nXv9n1zPpQFV68Wzz8%3D&reserved=0>
>
> On Fri, Dec 16, 2022 at 4:01 PM Rose, John B <jbrose@utk.edu.invalid>
> wrote:
>
> We would like to control access to a web site based on a listed domain and
> redirect any accesses from domains not
> listed to a particular web page.
>
> We need to be able to use the domain names and not IP addresses.
>
> Is this something we should be able to do within .htaccess and using
> Rewrite for the redirect or do we need to use something else?
>
> Thanks
>
>
>
>
> --
> Thanks,
> Brian Wolfe
> https://www.linkedin.com/in/brian-wolfe-3136425a/
> <https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.linkedin.com%2Fin%2Fbrian-wolfe-3136425a%2F&data=05%7C01%7Cjbrose%40utk.edu%7C8c53f584788a4c5ffd3108dadfa9c6ce%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068217538638429%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Vymgo6BPWgHQmHjYfLGxTQJiMIDyuI1Z3JgwSnNT0jM%3D&reserved=0>
>
>
Re: Controlling access to web site based on domain name [ In reply to ]
"you can require the traffic to match a certain rDNS value"

rDNS means Reverse DNS

I am not sure they want to do something like reverse DNS lookup.


________________________________
From: Frank Gingras <thumbs@apache.org>
Sent: Friday, December 16, 2022 4:33 PM
To: users@httpd.apache.org <users@httpd.apache.org>
Subject: Re: [users@httpd] Controlling access to web site based on domain name

You're referring to controlling access via the referrer, which is trivial to spoof; I strongly recommend not using that approach.

The other concept to understand here is that you can require the traffic to match a certain rDNS value.

If you still want to match the referrer, you can do so with <If, expr or a RewriteCond.


On Fri, Dec 16, 2022 at 4:28 PM Rose, John B <jbrose@utk.edu.invalid> wrote:
Brain

Thanks for replying.

I think I may not have worded my question clearly...'

If I have web site ...
mysite.abc.com<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmysite.abc.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Mvr4gSjeagVJ3pmQXc0gpxDeo%2Fa1fvqlU45yHtE%2FOTI%3D&reserved=0>

In the htaccess on that page I put something like ... Require def.com<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdef.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=MI6XVBSza0FCavAfVhO7wjZjykMU9vIWZjSq5AshmWM%3D&reserved=0>

And I want users from a link on the page somesite.def.com<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsomesite.def.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=N4HTKqPbanV5Fvu0i85ayEFdzSwccBBVeRANlWt5ic0%3D&reserved=0> to be able to access mysite.abc.com<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmysite.abc.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Mvr4gSjeagVJ3pmQXc0gpxDeo%2Fa1fvqlU45yHtE%2FOTI%3D&reserved=0> by clicking on that link

But I dont want anyone from a link on a site named somesite.xyz.com<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsomesite.xyz.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=NgM0v6amOxrgs%2FnrHbIYWXRmPkTPNPPLOHDWBrYsU%2BI%3D&reserved=0> to be able to access the homepaage on mysite.abc.com<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmysite.abc.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Mvr4gSjeagVJ3pmQXc0gpxDeo%2Fa1fvqlU45yHtE%2FOTI%3D&reserved=0>. I want to redirect them to mysite.abc.com/info.html<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmysite.abc.com%2Finfo.html&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=E%2BNoDuJgMMNw2vfidhXAdmqh42oFm1fnZ%2FcmaVl0urE%3D&reserved=0>

So any domain not explicitly listed in htaccess file will get redirected.


________________________________
From: Brian Wolfe <wolfebrian2120@gmail.com<mailto:wolfebrian2120@gmail.com>>
Sent: Friday, December 16, 2022 4:08 PM
To: jbrose@utk.edu.invalid <jbrose@utk.edu.invalid>
Cc: users@httpd.apache.org<mailto:users@httpd.apache.org> <users@httpd.apache.org<mailto:users@httpd.apache.org>>
Subject: Re: [users@httpd] Controlling access to web site based on domain name

You don't often get email from wolfebrian2120@gmail.com<mailto:wolfebrian2120@gmail.com>. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
Have you looked into virtual hosts configurations?

https://httpd.apache.org/docs/2.4/vhosts/examples.html<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fhttpd.apache.org%2Fdocs%2F2.4%2Fvhosts%2Fexamples.html&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=whBJuu6xgOhfdhKyiZ8JBMq5Q59DXiLUHi4TrOLYEXA%3D&reserved=0>

On Fri, Dec 16, 2022 at 4:01 PM Rose, John B <jbrose@utk.edu.invalid> wrote:
We would like to control access to a web site based on a listed domain and redirect any accesses from domains not
listed to a particular web page.

We need to be able to use the domain names and not IP addresses.

Is this something we should be able to do within .htaccess and using Rewrite for the redirect or do we need to use something else?

Thanks




--
Thanks,
Brian Wolfe
https://www.linkedin.com/in/brian-wolfe-3136425a/<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.linkedin.com%2Fin%2Fbrian-wolfe-3136425a%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=rVMxtC7A3yKNztZAi4t8Hn0pPzgxlh7%2FusOApzY9t5c%3D&reserved=0>
Re: Controlling access to web site based on domain name [ In reply to ]
Thanks for your reply.

Using the referrer, and I have 30 specific domains I want to allow to access a particular page, but any other referrer domain I do not want to allow to access that page, and i want to redirect access from those disallowed referrers to another specific page.

So can I put all 30 allowed domains in a "RewriteCond" statement or is there some better way to do that?


________________________________
From: Frank Gingras <thumbs@apache.org>
Sent: Friday, December 16, 2022 4:33 PM
To: users@httpd.apache.org <users@httpd.apache.org>
Subject: Re: [users@httpd] Controlling access to web site based on domain name

You're referring to controlling access via the referrer, which is trivial to spoof; I strongly recommend not using that approach.

The other concept to understand here is that you can require the traffic to match a certain rDNS value.

If you still want to match the referrer, you can do so with <If, expr or a RewriteCond.


On Fri, Dec 16, 2022 at 4:28 PM Rose, John B <jbrose@utk.edu.invalid> wrote:
Brain

Thanks for replying.

I think I may not have worded my question clearly...'

If I have web site ...
mysite.abc.com<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmysite.abc.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Mvr4gSjeagVJ3pmQXc0gpxDeo%2Fa1fvqlU45yHtE%2FOTI%3D&reserved=0>

In the htaccess on that page I put something like ... Require def.com<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdef.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=MI6XVBSza0FCavAfVhO7wjZjykMU9vIWZjSq5AshmWM%3D&reserved=0>

And I want users from a link on the page somesite.def.com<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsomesite.def.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=N4HTKqPbanV5Fvu0i85ayEFdzSwccBBVeRANlWt5ic0%3D&reserved=0> to be able to access mysite.abc.com<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmysite.abc.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Mvr4gSjeagVJ3pmQXc0gpxDeo%2Fa1fvqlU45yHtE%2FOTI%3D&reserved=0> by clicking on that link

But I dont want anyone from a link on a site named somesite.xyz.com<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsomesite.xyz.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=NgM0v6amOxrgs%2FnrHbIYWXRmPkTPNPPLOHDWBrYsU%2BI%3D&reserved=0> to be able to access the homepaage on mysite.abc.com<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmysite.abc.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Mvr4gSjeagVJ3pmQXc0gpxDeo%2Fa1fvqlU45yHtE%2FOTI%3D&reserved=0>. I want to redirect them to mysite.abc.com/info.html<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmysite.abc.com%2Finfo.html&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=E%2BNoDuJgMMNw2vfidhXAdmqh42oFm1fnZ%2FcmaVl0urE%3D&reserved=0>

So any domain not explicitly listed in htaccess file will get redirected.


________________________________
From: Brian Wolfe <wolfebrian2120@gmail.com<mailto:wolfebrian2120@gmail.com>>
Sent: Friday, December 16, 2022 4:08 PM
To: jbrose@utk.edu.invalid <jbrose@utk.edu.invalid>
Cc: users@httpd.apache.org<mailto:users@httpd.apache.org> <users@httpd.apache.org<mailto:users@httpd.apache.org>>
Subject: Re: [users@httpd] Controlling access to web site based on domain name

You don't often get email from wolfebrian2120@gmail.com<mailto:wolfebrian2120@gmail.com>. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
Have you looked into virtual hosts configurations?

https://httpd.apache.org/docs/2.4/vhosts/examples.html<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fhttpd.apache.org%2Fdocs%2F2.4%2Fvhosts%2Fexamples.html&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=whBJuu6xgOhfdhKyiZ8JBMq5Q59DXiLUHi4TrOLYEXA%3D&reserved=0>

On Fri, Dec 16, 2022 at 4:01 PM Rose, John B <jbrose@utk.edu.invalid> wrote:
We would like to control access to a web site based on a listed domain and redirect any accesses from domains not
listed to a particular web page.

We need to be able to use the domain names and not IP addresses.

Is this something we should be able to do within .htaccess and using Rewrite for the redirect or do we need to use something else?

Thanks




--
Thanks,
Brian Wolfe
https://www.linkedin.com/in/brian-wolfe-3136425a/<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.linkedin.com%2Fin%2Fbrian-wolfe-3136425a%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=rVMxtC7A3yKNztZAi4t8Hn0pPzgxlh7%2FusOApzY9t5c%3D&reserved=0>
Re: Controlling access to web site based on domain name [ In reply to ]
Then use a RewriteMap.

On Thu, Dec 22, 2022 at 9:37 AM Rose, John B <jbrose@utk.edu.invalid> wrote:

> Thanks for your reply.
>
> Using the referrer, and I have 30 specific domains I want to allow to
> access a particular page, but any other referrer domain I do not want to
> allow to access that page, and i want to redirect access from those
> disallowed referrers to another specific page.
>
> So can I put all 30 allowed domains in a "RewriteCond" statement or is
> there some better way to do that?
>
>
> ------------------------------
> *From:* Frank Gingras <thumbs@apache.org>
> *Sent:* Friday, December 16, 2022 4:33 PM
> *To:* users@httpd.apache.org <users@httpd.apache.org>
> *Subject:* Re: [users@httpd] Controlling access to web site based on
> domain name
>
> You're referring to controlling access via the referrer, which is trivial
> to spoof; I strongly recommend not using that approach.
>
> The other concept to understand here is that you can require the traffic
> to match a certain rDNS value.
>
> If you still want to match the referrer, you can do so with <If, expr or a
> RewriteCond.
>
>
> On Fri, Dec 16, 2022 at 4:28 PM Rose, John B <jbrose@utk.edu.invalid>
> wrote:
>
> Brain
>
> Thanks for replying.
>
> I think I may not have worded my question clearly...'
>
> If I have web site ...
> mysite.abc.com
> <https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmysite.abc.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Mvr4gSjeagVJ3pmQXc0gpxDeo%2Fa1fvqlU45yHtE%2FOTI%3D&reserved=0>
>
> In the htaccess on that page I put something like ... Require def.com
> <https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdef.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=MI6XVBSza0FCavAfVhO7wjZjykMU9vIWZjSq5AshmWM%3D&reserved=0>
>
> And I want users from a link on the page somesite.def.com
> <https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsomesite.def.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=N4HTKqPbanV5Fvu0i85ayEFdzSwccBBVeRANlWt5ic0%3D&reserved=0>
> to be able to access mysite.abc.com
> <https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmysite.abc.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Mvr4gSjeagVJ3pmQXc0gpxDeo%2Fa1fvqlU45yHtE%2FOTI%3D&reserved=0>
> by clicking on that link
>
> But I dont want anyone from a link on a site named somesite.xyz.com
> <https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsomesite.xyz.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=NgM0v6amOxrgs%2FnrHbIYWXRmPkTPNPPLOHDWBrYsU%2BI%3D&reserved=0>
> to be able to access the homepaage on mysite.abc.com
> <https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmysite.abc.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Mvr4gSjeagVJ3pmQXc0gpxDeo%2Fa1fvqlU45yHtE%2FOTI%3D&reserved=0>.
> I want to redirect them to mysite.abc.com/info.html
> <https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmysite.abc.com%2Finfo.html&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=E%2BNoDuJgMMNw2vfidhXAdmqh42oFm1fnZ%2FcmaVl0urE%3D&reserved=0>
>
> So any domain not explicitly listed in htaccess file will get redirected.
>
>
> ------------------------------
> *From:* Brian Wolfe <wolfebrian2120@gmail.com>
> *Sent:* Friday, December 16, 2022 4:08 PM
> *To:* jbrose@utk.edu.invalid <jbrose@utk.edu.invalid>
> *Cc:* users@httpd.apache.org <users@httpd.apache.org>
> *Subject:* Re: [users@httpd] Controlling access to web site based on
> domain name
>
> You don't often get email from wolfebrian2120@gmail.com. Learn why this
> is important <https://aka.ms/LearnAboutSenderIdentification>
> Have you looked into virtual hosts configurations?
>
> https://httpd.apache.org/docs/2.4/vhosts/examples.html
> <https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fhttpd.apache.org%2Fdocs%2F2.4%2Fvhosts%2Fexamples.html&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=whBJuu6xgOhfdhKyiZ8JBMq5Q59DXiLUHi4TrOLYEXA%3D&reserved=0>
>
> On Fri, Dec 16, 2022 at 4:01 PM Rose, John B <jbrose@utk.edu.invalid>
> wrote:
>
> We would like to control access to a web site based on a listed domain and
> redirect any accesses from domains not
> listed to a particular web page.
>
> We need to be able to use the domain names and not IP addresses.
>
> Is this something we should be able to do within .htaccess and using
> Rewrite for the redirect or do we need to use something else?
>
> Thanks
>
>
>
>
> --
> Thanks,
> Brian Wolfe
> https://www.linkedin.com/in/brian-wolfe-3136425a/
> <https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.linkedin.com%2Fin%2Fbrian-wolfe-3136425a%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=rVMxtC7A3yKNztZAi4t8Hn0pPzgxlh7%2FusOApzY9t5c%3D&reserved=0>
>
>
RE: Controlling access to web site based on domain name [ In reply to ]
Hi,
Just checking, are you interested acquiring the list of attendees? Please respond my email. I'm waiting for your response.
Thank you.








From: Rose, John B <jbrose@utk.edu.INVALID>
Sent: Saturday, December 17, 2022 2:30 AM
To: users@httpd.apache.org
Subject: [users@httpd] Controlling access to web site based on domain name

We would like to control access to a web site based on a listed domain and redirect any accesses from domains not
listed to a particular web page.

We need to be able to use the domain names and not IP addresses.

Is this something we should be able to do within .htaccess and using Rewrite for the redirect or do we need to use something else?

Thanks
RE: Controlling access to web site based on domain name [ In reply to ]
Hi,
Just checking, are you interested acquiring the list of attendees? Please respond my email. I'm waiting for your response.
Thank you.








From: Brian Wolfe <wolfebrian2120@gmail.com>
Sent: Saturday, December 17, 2022 2:38 AM
To: jbrose@utk.edu.invalid
Cc: users@httpd.apache.org
Subject: Re: [users@httpd] Controlling access to web site based on domain name

Have you looked into virtual hosts configurations?

https://httpd.apache.org/docs/2.4/vhosts/examples.html

On Fri, Dec 16, 2022 at 4:01 PM Rose, John B <jbrose@utk.edu.invalid<mailto:jbrose@utk.edu.invalid>> wrote:
We would like to control access to a web site based on a listed domain and redirect any accesses from domains not
listed to a particular web page.

We need to be able to use the domain names and not IP addresses.

Is this something we should be able to do within .htaccess and using Rewrite for the redirect or do we need to use something else?

Thanks




--
Thanks,
Brian Wolfe
https://www.linkedin.com/in/brian-wolfe-3136425a/
RE: Controlling access to web site based on domain name [ In reply to ]
Hi,
Just checking, are you interested acquiring the list of attendees? Please respond my email. I'm waiting for your response.
Thank you.







-----Original Message-----
From: jim@k6ccc.org <jim@k6ccc.org>
Sent: Saturday, December 17, 2022 2:43 AM
To: users@httpd.apache.org
Subject: RE: [users@httpd] Controlling access to web site based on domain name

Brian beat me to it. Set up virtual hosts with the desired domain listed and the default (what someone will get if they access via IP) goes to your desired "wrong way to get here" page.

Jim




-----Original Message-----
From: "Rose, John B" <jbrose@utk.edu.INVALID>
Sent: Friday, December 16, 2022 13:00
To: "users@httpd.apache.org" <users@httpd.apache.org>
Subject: [users@httpd] Controlling access to web site based on domain name

We would like to control access to a web site based on a listed domain and redirect any accesses from domains not listed to a particular web page.

We need to be able to use the domain names and not IP addresses.

Is this something we should be able to do within .htaccess and using Rewrite for the redirect or do we need to use something else?

Thanks





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
RE: Controlling access to web site based on domain name [ In reply to ]
Hi,
Just checking, are you interested acquiring the list of attendees? Please respond my email. I'm waiting for your response.
Thank you.








From: Rose, John B <jbrose@utk.edu.INVALID>
Sent: Saturday, December 17, 2022 2:58 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Controlling access to web site based on domain name

Brain

Thanks for replying.

I think I may not have worded my question clearly...'

If I have web site ...
mysite.abc.com

In the htaccess on that page I put something like ... Require def.com

And I want users from a link on the page somesite.def.com to be able to access mysite.abc.com by clicking on that link

But I dont want anyone from a link on a site named somesite.xyz.com to be able to access the homepaage on mysite.abc.com. I want to redirect them to mysite.abc.com/info.html

So any domain not explicitly listed in htaccess file will get redirected.


________________________________
From: Brian Wolfe <wolfebrian2120@gmail.com<mailto:wolfebrian2120@gmail.com>>
Sent: Friday, December 16, 2022 4:08 PM
To: jbrose@utk.edu.invalid<mailto:jbrose@utk.edu.invalid> <jbrose@utk.edu.invalid<mailto:jbrose@utk.edu.invalid>>
Cc: users@httpd.apache.org<mailto:users@httpd.apache.org> <users@httpd.apache.org<mailto:users@httpd.apache.org>>
Subject: Re: [users@httpd] Controlling access to web site based on domain name

You don't often get email from wolfebrian2120@gmail.com<mailto:wolfebrian2120@gmail.com>. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
Have you looked into virtual hosts configurations?

https://httpd.apache.org/docs/2.4/vhosts/examples.html<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fhttpd.apache.org%2Fdocs%2F2.4%2Fvhosts%2Fexamples.html&data=05%7C01%7Cjbrose%40utk.edu%7C8c53f584788a4c5ffd3108dadfa9c6ce%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068217538638429%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2FRKjCoB6a%2Fr5D8m9NzJUgpHn7nXv9n1zPpQFV68Wzz8%3D&reserved=0>

On Fri, Dec 16, 2022 at 4:01 PM Rose, John B <jbrose@utk.edu.invalid<mailto:jbrose@utk.edu.invalid>> wrote:
We would like to control access to a web site based on a listed domain and redirect any accesses from domains not
listed to a particular web page.

We need to be able to use the domain names and not IP addresses.

Is this something we should be able to do within .htaccess and using Rewrite for the redirect or do we need to use something else?

Thanks




--
Thanks,
Brian Wolfe
https://www.linkedin.com/in/brian-wolfe-3136425a/<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.linkedin.com%2Fin%2Fbrian-wolfe-3136425a%2F&data=05%7C01%7Cjbrose%40utk.edu%7C8c53f584788a4c5ffd3108dadfa9c6ce%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068217538638429%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Vymgo6BPWgHQmHjYfLGxTQJiMIDyuI1Z3JgwSnNT0jM%3D&reserved=0>
RE: Controlling access to web site based on domain name [ In reply to ]
Hi,
Just checking, are you interested acquiring the list of attendees? Please respond my email. I'm waiting for your response.
Thank you.








From: Frank Gingras <thumbs@apache.org>
Sent: Saturday, December 17, 2022 3:04 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Controlling access to web site based on domain name

You're referring to controlling access via the referrer, which is trivial to spoof; I strongly recommend not using that approach.

The other concept to understand here is that you can require the traffic to match a certain rDNS value.

If you still want to match the referrer, you can do so with <If, expr or a RewriteCond.


On Fri, Dec 16, 2022 at 4:28 PM Rose, John B <jbrose@utk.edu.invalid<mailto:jbrose@utk.edu.invalid>> wrote:
Brain

Thanks for replying.

I think I may not have worded my question clearly...'

If I have web site ...
mysite.abc.com<http://mysite.abc.com>

In the htaccess on that page I put something like ... Require def.com<http://def.com>

And I want users from a link on the page somesite.def.com<http://somesite.def.com> to be able to access mysite.abc.com<http://mysite.abc.com> by clicking on that link

But I dont want anyone from a link on a site named somesite.xyz.com<http://somesite.xyz.com> to be able to access the homepaage on mysite.abc.com<http://mysite.abc.com>. I want to redirect them to mysite.abc.com/info.html<http://mysite.abc.com/info.html>

So any domain not explicitly listed in htaccess file will get redirected.


________________________________
From: Brian Wolfe <wolfebrian2120@gmail.com<mailto:wolfebrian2120@gmail.com>>
Sent: Friday, December 16, 2022 4:08 PM
To: jbrose@utk.edu.invalid<mailto:jbrose@utk.edu.invalid> <jbrose@utk.edu.invalid<mailto:jbrose@utk.edu.invalid>>
Cc: users@httpd.apache.org<mailto:users@httpd.apache.org> <users@httpd.apache.org<mailto:users@httpd.apache.org>>
Subject: Re: [users@httpd] Controlling access to web site based on domain name

You don't often get email from wolfebrian2120@gmail.com<mailto:wolfebrian2120@gmail.com>. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
Have you looked into virtual hosts configurations?

https://httpd.apache.org/docs/2.4/vhosts/examples.html<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fhttpd.apache.org%2Fdocs%2F2.4%2Fvhosts%2Fexamples.html&data=05%7C01%7Cjbrose%40utk.edu%7C8c53f584788a4c5ffd3108dadfa9c6ce%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068217538638429%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2FRKjCoB6a%2Fr5D8m9NzJUgpHn7nXv9n1zPpQFV68Wzz8%3D&reserved=0>

On Fri, Dec 16, 2022 at 4:01 PM Rose, John B <jbrose@utk.edu.invalid<mailto:jbrose@utk.edu.invalid>> wrote:
We would like to control access to a web site based on a listed domain and redirect any accesses from domains not
listed to a particular web page.

We need to be able to use the domain names and not IP addresses.

Is this something we should be able to do within .htaccess and using Rewrite for the redirect or do we need to use something else?

Thanks




--
Thanks,
Brian Wolfe
https://www.linkedin.com/in/brian-wolfe-3136425a/<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.linkedin.com%2Fin%2Fbrian-wolfe-3136425a%2F&data=05%7C01%7Cjbrose%40utk.edu%7C8c53f584788a4c5ffd3108dadfa9c6ce%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068217538638429%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Vymgo6BPWgHQmHjYfLGxTQJiMIDyuI1Z3JgwSnNT0jM%3D&reserved=0>
RE: Controlling access to web site based on domain name [ In reply to ]
Hi,
Just checking, are you interested acquiring the list of attendees? Please respond my email. I'm waiting for your response.
Thank you.








From: Rose, John B <jbrose@utk.edu.INVALID>
Sent: Saturday, December 17, 2022 3:58 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Controlling access to web site based on domain name

"you can require the traffic to match a certain rDNS value"

rDNS means Reverse DNS

I am not sure they want to do something like reverse DNS lookup.


________________________________
From: Frank Gingras <thumbs@apache.org<mailto:thumbs@apache.org>>
Sent: Friday, December 16, 2022 4:33 PM
To: users@httpd.apache.org<mailto:users@httpd.apache.org> <users@httpd.apache.org<mailto:users@httpd.apache.org>>
Subject: Re: [users@httpd] Controlling access to web site based on domain name

You're referring to controlling access via the referrer, which is trivial to spoof; I strongly recommend not using that approach.

The other concept to understand here is that you can require the traffic to match a certain rDNS value.

If you still want to match the referrer, you can do so with <If, expr or a RewriteCond.


On Fri, Dec 16, 2022 at 4:28 PM Rose, John B <jbrose@utk.edu.invalid<mailto:jbrose@utk.edu.invalid>> wrote:
Brain

Thanks for replying.

I think I may not have worded my question clearly...'

If I have web site ...
mysite.abc.com<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmysite.abc.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Mvr4gSjeagVJ3pmQXc0gpxDeo%2Fa1fvqlU45yHtE%2FOTI%3D&reserved=0>

In the htaccess on that page I put something like ... Require def.com<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdef.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=MI6XVBSza0FCavAfVhO7wjZjykMU9vIWZjSq5AshmWM%3D&reserved=0>

And I want users from a link on the page somesite.def.com<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsomesite.def.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=N4HTKqPbanV5Fvu0i85ayEFdzSwccBBVeRANlWt5ic0%3D&reserved=0> to be able to access mysite.abc.com<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmysite.abc.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Mvr4gSjeagVJ3pmQXc0gpxDeo%2Fa1fvqlU45yHtE%2FOTI%3D&reserved=0> by clicking on that link

But I dont want anyone from a link on a site named somesite.xyz.com<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsomesite.xyz.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=NgM0v6amOxrgs%2FnrHbIYWXRmPkTPNPPLOHDWBrYsU%2BI%3D&reserved=0> to be able to access the homepaage on mysite.abc.com<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmysite.abc.com%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Mvr4gSjeagVJ3pmQXc0gpxDeo%2Fa1fvqlU45yHtE%2FOTI%3D&reserved=0>. I want to redirect them to mysite.abc.com/info.html<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmysite.abc.com%2Finfo.html&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=E%2BNoDuJgMMNw2vfidhXAdmqh42oFm1fnZ%2FcmaVl0urE%3D&reserved=0>

So any domain not explicitly listed in htaccess file will get redirected.


________________________________
From: Brian Wolfe <wolfebrian2120@gmail.com<mailto:wolfebrian2120@gmail.com>>
Sent: Friday, December 16, 2022 4:08 PM
To: jbrose@utk.edu.invalid<mailto:jbrose@utk.edu.invalid> <jbrose@utk.edu.invalid<mailto:jbrose@utk.edu.invalid>>
Cc: users@httpd.apache.org<mailto:users@httpd.apache.org> <users@httpd.apache.org<mailto:users@httpd.apache.org>>
Subject: Re: [users@httpd] Controlling access to web site based on domain name

You don't often get email from wolfebrian2120@gmail.com<mailto:wolfebrian2120@gmail.com>. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
Have you looked into virtual hosts configurations?

https://httpd.apache.org/docs/2.4/vhosts/examples.html<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fhttpd.apache.org%2Fdocs%2F2.4%2Fvhosts%2Fexamples.html&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=whBJuu6xgOhfdhKyiZ8JBMq5Q59DXiLUHi4TrOLYEXA%3D&reserved=0>

On Fri, Dec 16, 2022 at 4:01 PM Rose, John B <jbrose@utk.edu.invalid<mailto:jbrose@utk.edu.invalid>> wrote:
We would like to control access to a web site based on a listed domain and redirect any accesses from domains not
listed to a particular web page.

We need to be able to use the domain names and not IP addresses.

Is this something we should be able to do within .htaccess and using Rewrite for the redirect or do we need to use something else?

Thanks




--
Thanks,
Brian Wolfe
https://www.linkedin.com/in/brian-wolfe-3136425a/<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.linkedin.com%2Fin%2Fbrian-wolfe-3136425a%2F&data=05%7C01%7Cjbrose%40utk.edu%7Cdf01786b3ed14f0ed24608dadfad377b%7C515813d9717d45dd9eca9aa19c09d6f9%7C0%7C0%7C638068232297166282%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=rVMxtC7A3yKNztZAi4t8Hn0pPzgxlh7%2FusOApzY9t5c%3D&reserved=0>