Forum Moderators: phranque
My htaccess file looks like this:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.newdomain\.com
RewriteRule (.*) [newdomain.com...] [R=301,QSA,L]
For example, I am calling PHP from my Javascript file as follows:
$("#loginid").load("/server/myPHP.php?what=5",checkSessionIsActive);
If I echo the 'what' parameter inside my PHP file, I get it correctly as 5 without redirection. However, when I redirect, I get a blank.
I have been struggling with this for the last 2 - 3 days. Any help will be deeply appreciated.
Thanks
If you are redirecting from one server or hosting account to another, be sure to check the mod_rewrite code on the other server/host as well; The query may be getting corrupted there.
You may have simplified the actual code and/or query for posting here. If so, be aware that certain characters cannot be used in URLs without being encoded. Other characters cannot be used in query strings unless they are encoded. Your script may need to handle un-encoding characters that Apache encodes during the redirect. A query of literally "what=5" should not present a problem, but if you've simplified your example too much, it may be hiding a problem.
Jim