The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    6
    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?something, 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:
     
  2. mickeymouse

    mickeymouse Well-Known Member

    Joined:
    Sep 16, 2003
    Messages:
    389
    Likes Received:
    0
    Trophy Points:
    16
    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:
    1
    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