LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 01-05-2018, 04:42 AM   #1
alaayush
LQ Newbie
 
Registered: Jan 2018
Location: Nepal
Posts: 1

Rep: Reputation: Disabled
How to redirect all http-requests from devices connected via AP to localhost or the static ip address of rpi?


I have created a website which has plenty of movies/songs using laravel framework and apache server in Raspbian Stretch.

Also, I have configured rpi as an AP and i want to redirect all http-requests from devices connected via AP to the localhost or the address of pi.

After searching for days, i have made some requests to redirect by adding the line address=/#/ip_address_of_pi in /etc/dnsmasq.conf. But it doesn't redirect all requests like youtube.com, facebook.com

I have series of other questions related to this which are:

1. When i enter a site, say google.com, it gets redirected to localhost but the url bar still says google.com. How to make it change to localhost in url too.
2. google.com gets redirected but google.com/someaddress doesn't. why?

my /etc/dnsmasq.conf is:

Code:
interface=wlan0
    listen-address=192.168.1.2
    dhcp-range=192.168.1.3,192.168.1.23,255.255.255.0,12h
    address=/#/192.168.1.2
/etc/dhcpcd.conf is:

Code:
interface wlan0
    static ip_Address=192.168.1.21
    static domain_name_servers=192.168.1.2 127.0.0.1
/etc/resolv.conf is: generated by resolvconf

Code:
nameserver 127.0.0.1
/etc/hosts is :

Code:
127.0.0.1    localhost
    127.0.0.1    raspberrypi
    127.0.0.1    www.mysite.com (name of site i created)
Any help will be greatly appreciated. Thanks!
 
Old 01-07-2018, 02:30 AM   #2
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Maybe have a default vhost (that answers to any name) on your Pi with a redirect to the site on a named vhost.
 
  


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
Redirect http requests angle2009 Linux - Networking 6 12-18-2009 05:08 PM
Redirect outgoing http requests with IPtables highllamas Linux - Security 1 06-17-2009 08:07 AM
How do you properly redirect all web client requests from http to https? mehoggan Linux - Server 4 06-02-2009 03:49 AM
redirect all http requests to a different squid proxy server r2d2#jedi Linux - Networking 1 05-27-2009 12:31 AM
redirect some http requests to port 443. FMH Linux - Software 5 09-17-2007 08:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 08:59 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