Apache mod_rewrite mod_proxy subdomain to dir?

ProxyPassReverse games.example.com ProxyPassReverse games.example. Com:80 RewriteEngine On RewriteRule games(.*)$ http://games.example.com/games/$1 QSA,P,L.

This is won't work because games.example. Com/games/ doesn't exist, what I want example.com/games/signup/ == games.example. Com/signup/ the same issue if I have diffrent directories in the same of the subdomain to the root domain – mohd Dec 26 '10 at 16:43.

Pure mod_rewrite rules will not be enough, since they require mod_proxy as well to make the subrequests work correctly. Especially if you want all the absolute links to be auto rewritten as the page is served back. If you have full access to Apache, this code can be used in the virtualhost section of your example.org domain: Location /games> ProxyPassReverse games.example.org ProxyPassReverse games.example.org:80 RewriteEngine On RewriteRule games(.*)$ games.example.org/$1 QSA,P,L Make sure to load mod_proxy with the most restrictive settings and allow proxy requests though the ProxyPass directives Also ProxyPassReverse will NOT work in .

Htaccess.It has to be in the Apache vhost config itself Hope that helps!

Pure mod_rewrite rules will not be enough, since they require mod_proxy as well to make the subrequests work correctly. Especially if you want all the absolute links to be auto rewritten as the page is served back. If you have full access to Apache, this code can be used in the virtualhost section of your example.org domain: ProxyPassReverse games.example.org ProxyPassReverse games.example.org:80 RewriteEngine On RewriteRule games(.*)$ games.example.org/$1 QSA,P,L The last RewriteRule is really what you need, but the "P" flag will likely not work unless you can load mod_proxy as well.

Make sure to load mod_proxy with the most restrictive settings and allow proxy requests though the ProxyPass directives. Also ProxyPassReverse will NOT work in .htaccess. It has to be in the Apache vhost config itself.

Hope that helps!

Thanks mate, its wonderful, but my question now, if I want to access games.example. Org/signup with this rewrite rule I can access it throw examples. Org/games/signup?

Kindest regards – mohd Dec 23 '10 at 23:13 Exactly! It should get anything games(.*) and forward it to the correct URL. Actually one correction above (which I'll edit), the rewrite rule is supposed to reference the subdomain and not the original domain.

– Michael Petrov Dec 24 '10 at 2:10 what I am having now ProxyPassReverse games.example. Com ProxyPassReverse games.example. Com:80 RewriteEngine On RewriteRule games(.*)$ games.example.Com/$1 QSA,P,L it's working but its giving me this url www.example.com/web/login.php which will raise 404 page not found how can I append word games in any URL by being like this www.example.com/games/web/login.php?

– mohd Dec 26 '10 at 13:40.

Try replacing the RewriteRule with this instead: ProxyPass /games/ games.example. Com – Michael Petrov Jan 6 at 18:37.

Pure mod_rewrite rules will not be enough, since they require mod_proxy as well to make the subrequests work correctly. Especially if you want all the absolute links to be auto rewritten as the page is served back. The last RewriteRule is really what you need, but the "P" flag will likely not work unless you can load mod_proxy as well.

Make sure to load mod_proxy with the most restrictive settings and allow proxy requests though the ProxyPass directives. Also ProxyPassReverse will NOT work in .htaccess. It has to be in the Apache vhost config itself.

Hope that helps!

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions