BuffaloWeb

Well-Known Member
Jul 1, 2003
83
0
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?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:
 

mickeymouse

Well-Known Member
Sep 16, 2003
388
0
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,
 

ualymerej

Registered
Mar 19, 2005
1
0
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?