Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Help on a weird subdomain redirect

Discussion in 'General Discussion' started by BuffaloWeb, Sep 25, 2003.

  1. BuffaloWeb

    BuffaloWeb Well-Known Member

    Joined:
    Jul 1, 2003
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    156
    Hi,

    I have a client who has a subdomain set up: subdo.domain.com. He wants to redirect this subdomain to www.otherdomain.com/something?something. We entered this in the cpanel screen for redirecting subdomains, but the redirect instead sends you to www.otherdomain.com/something%3fsomething, that is, it substitutes "%3f" for "?". I know this has to do with apache's interpretation of "?", but does anyone know how to change this so that it correctly interperates the "?"? Maybe a rewrite in his htaccess?

    TIA!

    cPanel.net Support Ticket Number:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. mickeymouse

    mickeymouse Well-Known Member

    Joined:
    Sep 16, 2003
    Messages:
    389
    Likes Received:
    0
    Trophy Points:
    166
    Dear BuffaloWeb,

    Include these statements in .htaccess file to prevent replacing ? with %3f,

    RewriteEngine on
    RewriteRule ^/-(.*)-(.*\\?.*)$ $2&sessionid=$1 [L,R,QSA]
    RewriteRule ^/-(.*)-(.*)$ $2?sessionid=$1 [L,R,QSA]

    For more information on rewrite rule refer the the following URL :

    http://httpd.apache.org/docs-2.1/mod/mod_rewrite.html#rewriterule

    Regards,
     
  3. ualymerej

    ualymerej Registered

    Joined:
    Mar 19, 2005
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    151
    when i looked at my .htaccess file, i noticed that my older redirects were coded a little bit differently than my newer ones. The newer ones were the ones that had problems with replacing a question mark with %3f. The older ones said "Redirect temp /link url" but the newer ones said "RedirectMatch temp ^/link$ url" so i just deleted the "Match", the "^", and the "$" and now my redirects seem to work fine. Is there a fix so that the new redirects wont have all that extra coding?
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice