简体   繁体   English

如何捕获路由器发出的网址请求?

[英]How to capture url requests made by my router?

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. 我正在尝试在Dreamhost上部署我自己的动态DNS服务,并按照一些指南设法使服务器端正常运行-当我打开url时,将更新子域的DNS A记录。

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. 但是,当我将数据放在路由器上并尝试使其工作时(遵循dyndns或no-ip的标准),路由器无法更新。

Here's what I have: 1. Server side works as I expected. 这是我所拥有的:1.服务器端按预期工作。 2. Router works when using the default services (tested with no-ip) to update IP. 2.使用默认服务(经no-ip测试)更新IP时,路由器可以工作。 3. If I fail the authentication on my server, then router throws an auth failed error - it's accessing the server and authenticating. 3.如果我在服务器上的身份验证失败,则路由器会引发身份验证失败错误-它正在访问服务器并进行身份验证。 4. Tried logging to see if at any point the script is even accessed, and it's not. 4.尝试记录日志,以查看是否在任何时候都可以访问脚本,是否可以访问脚本。

So I think the router is requesting a url that is different than I expect. 因此,我认为路由器请求的URL与我预期的不同。 I tried with /, white /update/ and with /nic/update/ 我尝试使用/,白色/ update /和/ 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. 启动XAMPP,安装Wireshark,并尝试设置路由器以更新我自己的计算机。 Found the requests and found a 301 response since the router is asking for /nic/update? 因为路由器要求/ nic / update,所以找到了请求并找到了301响应? and I have it on /nic/update/?. 我在/ nic / update /?上有它。

Browser handles this redirect transparently but the router seems to not be requesting the new url. 浏览器透明地处理此重定向,但路由器似乎未在请求新的URL。 Might need to mess with mod_rewrite? 可能需要弄乱mod_rewrite吗?

As suspected, the router was taking the redirect as a bad reply. 如怀疑的那样,路由器将重定向视为错误回复。 After messing around with mod_rewrite I got it to work. 在弄乱了mod_rewrite之后,我开始使用它。

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]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用Fiddler捕捉xampp中发出的请求 - Catching requests made in xampp with fiddler 无需路由器即可从智能手机访问我的Latops XAMPP目录 - Access my latops XAMPP directories from smartphone without a router XAMPP-我的IP定向到路由器设置配置,而不是家用服务器 - XAMPP - my ip directs to router setup config instead of home server 如何在 Xampp 上运行带路由器的 React 项目 - How to run React Project w/ Router on Xampp 如何在 1 个路由器中通过 2 台 1 台笔记本部署 xmapp 服务器? - How to deploy xmapp server By 2 pc 1 notebook in 1 router? 如何在Xampp的apache服务器上运行eclipse中创建的Java webservice? - How run a java webservice made in eclipse run on the apache server in xampp? API请求在我的计算机上不起作用,但另一个 - API requests doesn't work on my computer but the other 当我尝试在 chrome 中运行我的代码时,我看到了我在 phpstorm 中编写的代码,而不是它必须执行的 function - When I try to run my code in chrome, i see the code that I have made in phpstorm and not the function that it has to do 为什么当我将查询字符串添加到我的 url 时,它会被 xampp 拒绝(“在此服务器上找不到请求的 URL”) - why when I add query string into my url it gets denied by xampp ('The requested URL was not found on this server') 如何在URL中隐藏目录 - How to hide directory in url
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM