LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-20-2023, 10:12 PM   #1
pinguim86
LQ Newbie
 
Registered: Apr 2020
Posts: 3

Rep: Reputation: Disabled
Apache2 Security - Show page when using ip public on browser. Public IP for multiple domains and multiple DNS records.


Hi,

I am using an apache2 software. I have multiples domains in an single server.
I need to redirect all incoming for an single page, when the client gets http://ip.

When the client get http://domain.co is fine.

How can I redirect all get from http://ip to a single page?

Thks
 
Old 05-05-2023, 08:26 AM   #2
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 415
Blog Entries: 2

Rep: Reputation: Disabled
The basic way to do this is use NamedBased virtual hosting.

The first vhost is the default, which is your page you want to land if nothing matches.

All the other vhosts are your domain names. It will only use that if it matches ServerName or SererAlias matches the name in the URL, so a URL with an IP will take the default.zs

The other way to do this is to use RewriteCond and match any host with anything that looks like an ip and redirect to the page using a RewriteRule.

The first method is more generic because it matches anything that doesn't have a VirtualHost. I guess the second minimizes the changes but you have to write a Regular expression to match an ip but most hosts don't start with a number so you don't have to do an exact match.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple PTR records for multiple domains L1nuxn00b703 Linux - Newbie 3 12-19-2012 01:49 AM
BIND DNS - MX, TXT and SPF records when hosting multiple domains on same machine? icebrian Linux - Networking 3 05-02-2011 08:21 AM
[SOLVED] MX Records / A Records / CNAME Records - Advice Please fusion1275 Linux - Newbie 15 01-18-2011 04:06 AM
Multiple emails accounts(with different from domains) on multiple domains on 1 server locoputo Linux - Server 0 04-12-2009 06:29 PM
DNS Zone Records - MX Records ddzc Linux - Software 8 05-24-2007 01:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration