---
# System prepended metadata

title: Untitled

---


- You have a base directory of example.com 
- In that directory we have sub directories containing separate OJS installations. Like /somejournalname (being served from /var/www/html/somejournalname)
- Loading that journal in a browser would mean:  
`example.com/somejournalname/index.php/somejournalname`  
which is not what we want.  
Removing index.php gets us example.com/somejournalname/somejournalname which is also not what we want.

## Possible Approaches
1. A base_url here of example.com/somejournalname might work. (but has not been thoroughly tested by folks I talked with)

1. if we want to use mod_rewrite to remove index.php/somejournalname PKP has a working set of RewriteRules for doing that that they have shared.  Then "we don't need to do anything with the base_url"

1. if you do that then you can just serve example.com/somejournalname (where somejournalname is the directory not the journal path) and do article/view/1234

## Testable URLs:

* Admin URL:  
  https://example.com/somejournalname/index/admin
* Issue URL:  
https://example.com/somejournalname/issue/view/3106
* Article URL:  
https://example.com/somejournalname/article/view/62465


## Possible Draft of Changes for apache rewrites:

```apache.conf
RewriteEngine On
RewriteBase /somejournalname
# Rewrite Admin link
RewriteRule ^/index/admin(.*) /index.php/index/admin$1 [L]

# Fixes CSS error on administration page
RewriteRule ^/index/(\$\$\$call\$\$\$/.*) /$1 [R=307,L]

# Rewrite index requests to the journal index
RewriteRule ^/(index.php)?/?$ /index.php/somejournalname/index [L]

# Rewrite custom domain to make api calls correctly
RewriteRule ^/(api/.*)$ /index.php/somejournalname/$1 [R=307,L]

# if the incoming request references the journal shortname,
# use an external redirect to strip the journal shortname
RewriteRule ^/somejournalname/(.*)$ /$1 [R,L]

# Normal request processing
# Ignore if this request references index.php already
RewriteCond %{REQUEST_URI} !/index.php/
# Ignore if request is for a known OJS directory (Apache 2.2+)
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI} !-d
# Ignore if request is for a known OJS file (Apache 2.2+)
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI} !-f

# Otherwise, rewrite all requests through index.php to this 
# specific journal shortname
RewriteRule ^(.*)$ /index.php/somejournalname/$1 [QSA,L]
```