0

I am writing a website using Railo. My code is to be deployed on a Railo Server running on Tomcat, overlayed on a regular Apache+PHP server.

I need to send all requests to http://subdomain.myserver.co.uk/ and its child files to the directory /public_html/railo/tomcat/webapps/ROOT/subdomain/ directory.

I defined a subdomain in cPanel, with the document root as /public_html/railo/tomcat/webapps/ROOT/subdomain/, but still requests to http://subdomain.myserver.co.uk/ display files in /public_html/railo/tomcat/webapps/ROOT/. I can view my files if I request http://subdomain.myserver.co.uk/subdomain/

I've been fiddling with the .htaccess files for quite some time now, but I'm stuck

Is there any way I can do what I'm trying to achieve, or am I resigned to get those pages using http://subdomain.myserver.co.uk/subdomain/

Pranav Hosangadi
  • 103
  • 1
  • 1
  • 5

1 Answers1

1

Put the following into /public_html/railo/tomcat/webapps/ROOT/.htaccess:

RewriteEngine on
RewriteCond %{HTTP_HOST} enterprise.myserver.co.uk
RewriteRule (.*) /public_html/railo/tomcat/webapps/ROOT/lfEnterprise$1

Here the target of the RewriteRule is a filesystem path, not a URL as is more common. RewriteRule will accept either, and figure out which one is meant. Please see the RewriteRule documentation for that and more.

Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47