Forum Moderators: phranque
-Avinash.
RewriteEngine on
RewriteLogLevel 9
RewriteLog "/usr/Hinstall/logs/rewrite.log"
RewriteCond %{REQUEST_URI} ^/business
RewriteRule ^/(.*)$ [ab04:81...] [L]
am i doing anything obivious wrong in here.
RewriteRule ^/business/(.*)$ http://ab04:81/$1 [R,L]
Hope this gives all the info u required.
Thanks for ur time
Additionaly you need to change the RewriteRule a bit, to tell mod_rewrite that the request should be placed through mod_proxy module, to do so replace the Redirect flag with Proxy flag.
To clarify what this rule is doing; it puts all requests starting with /business/ though mod_proxy which requests the page from the internal server, for example the [domain.com...] becomes [ab04:81...] on the ab04 server.
Please ot that if your server is using any of the virtual hosting methods, then you need to place the mod_rewrite directives (at least the RewriteRule) in a <VirtualHost/> container, otherwise it might not be parsed.
As you said i have enbaled the proxyrequest directive as well. But the rewrite rule is not working. From this machine when i telnet to ab04:81 it's connecting and request this "/business/forms/garantierisico.html" i am getting complete html output. In the Apache logs i get "/business/forms/garantierisico.html" 404 error.
Please help, Thanks in advance.
Below are setting of virtual host.
ProxyRequests on
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/business/(.*)$
RewriteRule ^/(.*)$ [gl04:81...]
RewriteLogLevel 9
RewriteLog /usr/Hinstall/logs/rewrite-test.log