@ctgraham Our OJS productive environment is not live yet so we can still modify the configuration. I’m testing the journal domain name rewriting in an ubuntu 16.04.1 virtual box and modify my windows host file to resolve the test-domains.
The ubuntu apache has the following 000-default.conf
<VirtualHost *:80>
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ServerName journals.uni-giessen.de
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
There are two other virtual hosts enabled with servername test1.domain
and servername test2.domain
. Both have the same document root /var/www/html.
OJS 3.0.1 is installed /var/www/html/ojs and i created two journals with the path test1 and test2. Without any rewrite setting i can easily access them.
The relevant lines from OJS config.inc.php
base_url = "http://journals.uni-giessen.de/ojs"
...
base_url[index] = http://journals.uni-giessen.de/ojs/index
base_url[test1] = http://test1.domain
base_url[test2] = http://test2.domain
...
restful_urls = On
In the OJS root directory /var/www/html/ojs there is a .htaccess file with the following adapted rewriting rules:
# hcgraham solution
RewriteEngine on
RewriteRule ^/(index.php)?/?$ /ojs/index.php/test1/index [L]
RewriteRule ^/test1/(.*)$ /$1 [R,L]
RewriteCond %{REQUEST_URI} !/index.php/
RewriteCond %{DOCUMENT_ROOT}ojs%{REQUEST_URI} !-d
RewriteCond %{DOCUMENT_ROOT}ojs%{REQUEST_URI} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /ojs/index.php/test1/$1 [QSA,L]
RewriteCond %{DOCUMENT_ROOT}ojs%{REQUEST_URI} -f
RewriteRule ^(.*)$ /ojs/$1 [QSA,L]
Ubuntu 16.04.1 is using Apache 2.4 so i commented out the {REQUEST_FILENAME} lines.
I can access http://journals.uni-giessen.de/ojs and http://test1.domain/ojs. Both display to the starting page of the Test1 Journal. Accessing http://test1.domain leads to the standard Ubuntu apache starting page in /var/www/html
It seems some style elements are applied but e.g. the magnifying glass in the search line is missing, the symbols at the PDF-Buttons are broken as well as the OJS-symbol in the footer:
There should also be a journal specific CSS-file changing the background color which is not applied. If you login as journals manager, many functions/links (like “My Queue” in Tasks etc.) in the backend are broken.
Our requirement is the same as described by @hcl