How to redirect www.foo.com/bar to www.foo.com:8080 without "really" changing the url in the url bar?
So I want www.foo.com/bar (+ possible GET parameters / subfolders) to be shown always in the url bar.
Can this be done with mod_rewrite?
How to redirect www.foo.com/bar to www.foo.com:8080 without "really" changing the url in the url bar?
So I want www.foo.com/bar (+ possible GET parameters / subfolders) to be shown always in the url bar.
Can this be done with mod_rewrite?
You need a proxy (mod_proxy) to do this. Here is an example with mod_rewrite’s RewriteRule
:
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^ http://%{HTTP_HOST}:8080%{REQUEST_URI} [P]
No it cant. The :8080 tells the browser what port to connect to the server on. If it's not present it assumes the default for whatever protocol prefix you have (http = 80, https = 443, ftp = 21 etc.)