1

I have a domain in GoDaddy and want to redirect it to another domain in GoDaddy also but the rediret is not passing the query string, is there something I can do so the redirection keeps the query string? example: www.1.example/?ID=2 is redirecting to www.2.example without the query string.

I have my business domain www.mybusiness.example and I have www.mybusiness.example/client1 www.mybusiness.example/client2 www.mybusiness.example/client3 and so on. But I want to give each client a custom domain that redirects to their specific URL but I need to keep the query strings.

1
  • 1
    How have you done the redirect? Commented Feb 20, 2024 at 10:14

1 Answer 1

0

If Godaddy supports PHP - which I would assume they do, and if you are keeping the old domain - you could write a basic script on the old website that handles the redirection, including the query string.

A simple form for this redirect might look as follows:

File: index.php

 <?php  
 header("Location: https://www.example2.com/".$_REQUEST['REQUEST_URI']);

This would handle the first part of your query.

The version in your second part is slightly more complex. In the simplest case you might write an index.php and have it in the clientX subdirectory on the old server -

  <php
  header("Location:https://customclient.domain/".$_SERVER['QUERY_STRING']);

I comment that $_SERVER has a lot of useful things for understanding and manipulating the request you received. Have a look at https://www.php.net/manual/en/reserved.variables.server.php

The above techniques are fairly generic - There are other techniques you may be able to use depending on your level of access and the type of servers Godaddy are running - for example using Rewrites and/or Redirects in .htaccess if they use Apache.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.