2

I have a GoDaddy account for my domain. I am forwarding a subdomain to a different server but the relative path is not getting passed when the 301 forward is done.

Example:

  • test.example.com -> test.cloudapp.net
  • test.example.com/?token=123 -> test.cloudapp.net (not passing token in redirect request)
  • 3
    Tip... if you want full control over your redirects... do not use GoDaddy Forwarding or any other registrar. Attach the domain to some hosting and use the .htaccess method. – Simon Hayter Aug 23 '18 at 19:19
  • "the relative path is not getting passed" - Your example shows a query string (as your title states) not a "relative path". Is the URL-path also not getting passed? – MrWhite Aug 23 '18 at 21:56
  • @SimonHayter Even if you implement the redirects yourself, I don't think the query string is usually passed along. With rewrite rules you have to use the QSA (query string append) flag to make that happen. – Stephen Ostermiller Aug 25 '18 at 13:58
  • @StephenOstermiller should be able to using RewriteCond %{QUERY_STRING} – Simon Hayter Aug 25 '18 at 15:04
  • Aside: With an Apache (and Nginx) redirect, the query string is passed by default (without any additional flags or reference to the QUERY_STRING server variable). The QSA flag (Apache mod_rewrite) is only required if you are explicitly including a query string on the substitution (target URL) and you want the query string from the request to also be appended (ie. merged). @StephenOstermiller – MrWhite Aug 25 '18 at 18:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.