I have set up a .htaccess file that redirects requests to a sub directory example.com/app/ to a sub domain app.example.com
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://app.example.com/$1 [R=301,L]
This works, but when a request with post parameters are sent to example.com/app/mcp.php the url is redirected to app.example.com/mcp.php without the post parameters.
My question is
- How do I redirect request from a sub directory to a sub domain with the post/get parameters?
This is not possible to do. the HTTP Spec prevents it. A full description of the problem can be found in this comment
https://stackoverflow.com/a/1562986/58456