Forum Discussion
Dec 21, 2016
Hi Basil
The browser would always send an URI, no matter if you don't enter one or not. If you don't it will resort to "/".
The only way an empty uri would reach a server afaik is if somebody is manually compiling a request and sending it. And if it did, the web server would reply with a 400 Bad request.
Please check the example below:
echo -ne "GET HTTP/1.1\r\nHost:mywebsite.com\r\nUser-agent: Mozilla/5.0\r\n\r\n" | nc 172.30.175.33 5919
HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=us-ascii
Server: Apache
Date: Wed, 21 Dec 2016 05:12:39 GMT
Connection: close
Content-Length: 324
Bad Request
Bad Request - Invalid URL
HTTP Error 400. The request URL is invalid.
The reason this is creating a redirect loop:
if { [HTTP::uri] eq "/" } {
HTTP::respond 302 Location “https://webpage.com/";
}
You're sending the user back to "/", which is set to send the user to "/"... and so forth. 🙂
Hope that answered your question?
/Patrik