When I point the same domain to other test sites on my web server, those websites will load without having to type the root directory in the address bar.
The contents of the /openemr directory can be uploaded directly into the root directory for demo.mydomain.com, updating the globals.php paths accordingly. That way the application already resides exactly where you want it.
If you prefer the redirection route, simply create a .htaccess file with a redirect statement, as follows.
My web root on SUSE is /srv/www/htdocs. I have openemr installed like this: /srv/www/htdocs/openemr. This is how it is specified in globals.php. I point my domain to /srv/www/htdocs/openemr. Are you saying to take the contents out of directory /srv/www/htdocs/openemr and then place them in srv/www/htdocs ?
Also, what is different about OpenEMR that it requires these adjustments for pointing a domain at it?
Sure, just put it in your htdocs directory. There’s nothing sacred abut the directory name “openemr”. It’s just the way it’s delivered.
Another thing you might consider is forcing the secure https protocol when visitors go into the openemr program directory. While the probability of browser hijacks that concern banks and credit card processors is low, patient data is private so it should still be protected with encryption. Again, the .htaccess file can do that for you, by using the following code:
Where your program subdirectory is /openemr. Edit the 3rd & 4th statements accordingly for different program directory names. Note that you’ll also need ssl enabled to use https. You might also consider buying a certificate from godaddy for $12.99/year so visitors’ browsers don’t return the nasty messages that they return for self-signed certificates.
We use subdomains like this to separate client practices and various testing installs. I always have to set two variables in globals.php to accomodate this:
$web_root = ""; // a null string
$webserver_root = "/path/to/your/openemr";
Make sure your DocumentRoot and Directory settings in your Apache vhost config point to that same directory. Reload Apache and you should be good.
I create user accounts on the server for each practice so all three of those paths would look like this:
Thank you for your suggestions. First I tried setting $web_root = "/"; in globals.php and the result was that the loading of openemr timed out. Not sure if this syntax is distro specific (I am running the latest CVS on a test box which has SUSE Linux Enterprise Server 11.0).
Next I set $web_root = ""; This worked!
This is cool. I was wondering why the default setup of openemr was not letting a subdomain point to it but it seems it was a matter of a global variable setting. Thanks a again!!