apache - Redirection to another port on the same server -
i have web application in http://example.com:8080/example-app/
when user types http://example.com/
, i'd redirect him web app.
options +followsymlinks rewriteengine on rewritecond %{http_host} (.*)example.com$ [nc] rewriterule ^(.*)$ http://example.com:8080/example-app/$1 [l,r=301]
i believe .htaccess has correct access right:
$ ls -altr /var/www/html/.htaccess -rw-r--r-- 1 apache apache 178 jul 2 00:31 /var/www/html/.htaccess
but navigating http://example.com/ serves index.html file.
can tell me why doesn't work? there way debug this? (apache on centos).
change server default listening port 8080 80 in configuration file 1 easy or try proxy tho redirect request below , default document root folder
namevirtualhost *:8080 <virtualhost *> serveradmin me@example.com servername www.example.com:8080 proxypreservehost on # setup proxy <proxy *> order allow,deny allow </proxy> proxypass / http://www.example.com:80/ proxypassreverse / http://www.example.com:80/ </virtualhost>
Comments
Post a Comment