How to capture url requests made by my router?

668 Views Asked by At

I'm trying to deploy my own Dynamic DNS service at Dreamhost and following some guides managed to get the server side functioning perfectly - when I open a url the DNS A record for a subdomain gets updated.

But when I place the data on the router and try to make it work (following the standards at dyndns or no-ip) the router fails to update.

Here's what I have: 1. Server side works as I expected. 2. Router works when using the default services (tested with no-ip) to update IP. 3. If I fail the authentication on my server, then router throws an auth failed error - it's accessing the server and authenticating. 4. Tried logging to see if at any point the script is even accessed, and it's not.

So I think the router is requesting a url that is different than I expect. I tried with /, white /update/ and with /nic/update/

At this point I wanted to see what the router is actually requesting. Fired up XAMPP, installed Wireshark, and tried to set the router to update my own computer. Found the requests and found a 301 response since the router is asking for /nic/update? and I have it on /nic/update/?.

Browser handles this redirect transparently but the router seems to not be requesting the new url. Might need to mess with mod_rewrite?

1

There are 1 best solutions below

0
On

As suspected, the router was taking the redirect as a bad reply. After messing around with mod_rewrite I got it to work.

Used this:

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.cgi [L]