Note that there are some explanatory texts on larger screens.

plurals
  1. POG-WAN URL rewrite for home page not working
    primarykey
    data
    text
    <p>I am trying to do a URL rewrite for the site home page. Here is a simplified version of my handler.</p> <pre><code>int init(int argc, char *argv[]) { u32 *states = (u32*)get_env(argv, US_HANDLER_STATES); *states = (1 &lt;&lt; HDL_AFTER_READ); return 0; } int main(int argc, char *argv[]) { xbuf_t *read_xbuf = (xbuf_t*)get_env(argv, READ_XBUF); xbuf_replfrto(read_xbuf, read_xbuf-&gt;ptr, read_xbuf-&gt;ptr + 16, " / ", " /?home "); return 255; } void clean(int argc, char *argv[]) {} </code></pre> <p>Basically it is just replacing " / " with " /?home ". So when user loaded "www.domain.com" it will give them the content of "home.c". Here is the result of the rewrite. Everything looks right I am not sure what's causing the issue.</p> <p>Original Request:</p> <pre><code>GET / HTTP/1.1 Host: localhost:8000 User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip, deflate Connection: keep-alive </code></pre> <p>Rewritten Request:</p> <pre><code>GET /?home HTTP/1.1 Host: localhost:8000 User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip, deflate Connection: keep-alive </code></pre> <p>After the rewrite this is the result.</p> <pre><code>GET http://localhost:8000/ -- response -- 0 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload