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)
7
  • 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. Commented Aug 23, 2018 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
    Commented Aug 23, 2018 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. Commented Aug 25, 2018 at 13:58
  • @StephenOstermiller should be able to using RewriteCond %{QUERY_STRING} Commented Aug 25, 2018 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
    Commented Aug 25, 2018 at 18:40

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.