: Redirect ALL requests to host IP I have a honeypot running on AP so if anyone connects and try's to browse it will redirect to the root page. I am using dnsmasq to do this with the following
I have a honeypot running on AP so if anyone connects and try's to browse it will redirect to the root page. I am using dnsmasq to do this with the following entry
log-facility=/var/log/dnsmasq.log
address=/#/10.0.0.1
interface=wlan0
dhcp-range=10.0.0.10,10.0.0.250,12h
no-resolv
log-queries
This works fine if someone were to go to example.com but if they try example.com/somerandompage.html I get a 404 error or if they try example.com it just times out.
What would be the best method to redirect everything to serverip/index.html while still allowing serverip/someOtherPage?with=options.html with a preference for .htaccess solution.
More posts by @Shelley277
1 Comments
Sorted by latest first Latest Oldest Best
if they try example.com/somerandompage.html I get a 404 error
To redirect all requests to example.com (non-HTTPS) back to the serverip/index.html in .htaccess (or perferably in your server config):
RewriteEngine On
RewriteCond %{HTTP_HOST} =example.com [NC]
RewriteRule ^ serverip/index.html [R=301,L]
This assumes your site is only accessible over example.com. If you also have the www subdomain then you would need to modify the condition to read:
RewriteCond %{HTTP_HOST} ^(www.)?example.com$ [NC]
This will also redirect example.com or does dnsmasq kick in before this?
if they try example.com it just times out.
You will only be able to resolve this by making your site accessible over HTTPS. ie. by installing a security certificate.
I have a honeypot...
If by "honeypot" you mean you are logging and blocking IPs/users that access the domain, then redirecting in .htaccess might skip this out (depending on when dnsmasq runs?). You could perhaps redirect to example.com instead?
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.