Forum Moderators: phranque
NameVirtualHost www.vhost.com
<VirtualHost www.vhost.com>
ServerName www.vhost.com
ProxyPreserveHost On
ProxyRequests Off
ProxyPass / http://10.10.10.5/
ProxyPassReverse / http://10.10.10.5/
RewriteEngine on
RewriteCond %{HTTP_HOST} ^([^.]+\.com) [NC]
RewriteRule ^/(.*)http://www.%1/$1 [R=301,L]
</VirtualHost>
if ($url=="localhost:8787" ) //check address
{
header( 'Location: http://www.vhost.com:8787/test.html' );
}
[edited by: jdMorgan at 2:19 pm (utc) on Jun 17, 2010]
[edit reason] De-linked [/edit]
[edited by: jdMorgan at 2:20 pm (utc) on Jun 17, 2010]
[edit reason] De-linked [/edit]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.vhost\.com:8787
RewriteRule ^$http://localhost:8787/ [L]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.vhost\.com
RewriteRule ^$http://localhost:8787/ [L]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.vhost\.com:8787
RewriteRule ^$/test.html [L]
I wrote the URL address in browser : "http://www.vhost.com:8787/"
And the result still 'index.php'(directoryindex), along with URL didn't change into "http://localhost:8787/"
Answer: "http://localhost:8787/"
Answer:Page will be redirected and linked to "http://www.vhost.com:8787/test.html" (already succeess!),
BUT THE URL don't changes into "www.vhost.com" (Mission Objective!)
URL input: "http://localhost:8787/"
output URL: "http://localhost:8787/..." or just "http://localhost:8787/"
output page: "test.html"
URL input: "http://localhost:8787/"
output URL: "http://www.vhost.com:8787/test.html"
output page: "test.html"
[edited by: jdMorgan at 2:17 pm (utc) on Jun 17, 2010]
[edit reason] De-linked [/edit]