Search code examples
resturl-rewritingg-wan

G-WAN: how to get rid of the "?" in URL and how to set default language?


  1. In G-WAN the default URL is in the form mydomain.com/?hello.c

    I want to get rid of the ? to have URLs that look like mydomain.com/hello

    The user manual mentions substituting a different character such as ' for ?. In that case the URL would look like mydomain.com/'hello.c

    But I don't want to use a different character, I want to get rid of the special character completely. Is that possible?

  2. The default language for G-WAN is C. So mydomain.com/?hello means mydomain.com/?hello.c

    How do I change the default to a different language, say Java, so that mydomain.com/?hello now means mydomain.com/?hello.java

    Can I set different default languages for different virtual hosts?

  3. Finally, how do I change the URL format for passing parameters? According to the user manual the default format is:

    mydomain.com/?hello.c&name=Eva

    I want to change it to:

    mydomain.com/hello?name=Eva

    Is that possible?


Solution

  • This has already been asked many times, and a few solutions are found here:

    G-WAN handler rewriting solution

    You should note, however, that the way you mean to pass arguments as ?something=answer instead of & only applies to the first argument passed. You can't do ?this=that?somethingelse=this because only the first can be ? and the rest must be &. In fact you can ignore using ? completely and only use & with virtually unlimited arguments so it's in fact better to stick to only using &.

    It's important to note for future reference to anyone asking similar questions, G-WAN gives you the entire headers through multiple steps of the HTTP transaction and being that you can modify them with c/c++, you can change anything at all that you want before the requests are handled by the server or sent back to the client. The only limitation is your knowledge and imagination.