0

I've an Apache HTTPD server (and it's driving me nuts already). I've configured several tomcat workers. So a https://something.domain/WebApp1/ activates the web-application on the specified tomcat via AJP.

However, due to a naming convention change I have to redirect the path https://something.domain/app1/ to https://something.domain/WebApp1/. So that the users practically only use the newer convention (WebApp1).

So I went to the httpd.conf file and activated mod_rewrite:

LoadModule rewrite_module modules/mod_rewrite.so

Beneath the "LoadModule"-block I've added the following snippet:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^/app1$ WebApp1 [R]
</IfModule>

I restarted the Apache httpd service and tried to access .../app1 and it just led me to the 404. What do I need to do to get this running?

OddDev
  • 111
  • 6

1 Answers1

2

You don't need mod_rewrite for this sort of operation a Redirect will be entirely sufficient.

Redirect /app1/ /WebApp1/

Clear your browser cache before re-requesting or use a command line tool.

If it still doesn't work then something else is wrong with the configuration. Either you have something that conflicts or the request isn't landing on the virtual host you think it is.

Unbeliever
  • 2,336
  • 1
  • 10
  • 19
  • I can't believe that it was that simple :D This mod_rewrite drove me nuts already! Thank you so so much! – OddDev Sep 12 '16 at 11:59