My Apache(Tomcat)-Spring server runs on port 8080. I want to make a call to localhost default port(80) and want a redirection to take place to port 8080.
I enabled mod-rewrite and the following rule from DigitalOcean works fine.
RewriteRule ^orange.html$ apple.html
I read the rewrite rules of apache from Apache URL Rewriting Doc
However the following rules does not work:
RewriteEngine On # Turn on the rewriting engine
RewriteCond %{SERVER_PORT} !^80$
RewriteRule ^/(.*) http://localhost:8080/$1 [L,R]
My intention is to allow cross domain support without enabling CORS in spring controller.(This is a hard rule)
The .htaccess is located in /var/www/html. Also I do not want other requests to be redirected on the port 8080 except which are on localhost/(my_specified_string)