Note that there are some explanatory texts on larger screens.

plurals
  1. POTomcat redirect taking user outside the domain
    text
    copied!<p>i have this config in my web.xml</p> <pre><code>&lt;servlet&gt; &lt;servlet-name&gt;welcome&lt;/servlet-name&gt; &lt;servlet-class&gt;com.me.util.WelcomeServletPublic&lt;/servlet-class&gt; &lt;init-param&gt; &lt;param-name&gt;redirect&lt;/param-name&gt; &lt;param-value&gt;/login/login.action&lt;/param-value&gt; &lt;/init-param&gt; &lt;/servlet&gt; &lt;welcome-file-list&gt; &lt;welcome-file&gt;welcome&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; </code></pre> <p>in my development environment this redirect worked just fine. now that everything is moved into my production environment, the redirect isn't working.</p> <p>whats supposed to happen is when you go to <a href="https://mydomain.com" rel="nofollow">https://mydomain.com</a> it redirects you to <a href="https://mydomain.com/login/login.action" rel="nofollow">https://mydomain.com/login/login.action</a></p> <p>whats happing is its redirecting to <a href="https://login/login.action" rel="nofollow">https://login/login.action</a>, its loosing the domain name</p> <p>now the big thing that has me wondering where its going wrong is how my production server is configured.</p> <p>at the front door, i have apache running mod_jk. there are two listeners, 80, and 443. the 80 listener is configured with mod_rewrite to take the http:// url and rewrite it to https://. the 443 listener then takes the request and dumps it down to mod_jk which redirects the request to tomcat via port 8009. tomcat is running about 6 applications, each in its own vhost.</p> <p>ive never had to do a configuration quite like this and don't know where to being troubleshooting this. i know i can't take the preceeding / out of the url in the servlet because then if someone went to mydomain.com/users, it would redirect them to mydomain.com/users/login/login.action, so i really don't know where to start.</p> <p>here is my apache vhost config</p> <pre><code> &lt;VirtualHost 10.99.10.30:80&gt; ServerName boardingsurvey.mydomain.org ServerAlias boardingsurvey.mydomain.org RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} &lt;/VirtualHost&gt; &lt;VirtualHost 10.99.10.30:443&gt; ServerName boardingsurvey.mydomain.org ServerAlias boardingsurvey.mydomain.org DocumentRoot /var/www/vhosts/bss &lt;Directory "/var/www/vhosts/bss"&gt; AllowOverride None Options Indexes FollowSymLinks Order allow,deny Allow from all &lt;/Directory&gt; JkMount /* bss SSLEngine on SSLCipherSuite ALL:!ADH:!EXP56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL SSLCertificateFile /etc/apache2/ssl/ssl.crt SSLCertificateKeyFile /etc/apache2/ssl/ssl.key SSLCertificateChainFile /etc/apache2/ssl/intermediate.crt &lt;/VirtualHost&gt; ~ </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload