96 lines
2.8 KiB
Markdown
96 lines
2.8 KiB
Markdown
# Clean User URLs for OJS 3.5
|
|
|
|
Targeted for the OJS 3.5.0-5 source tree supplied for testing.
|
|
|
|
The plugin changes the **site-level** account menu links and also rewrites the site-name/header link to `/`:
|
|
|
|
- Dashboard -> `/dashboard`
|
|
- Profile -> `/profile`
|
|
- Administration -> `/admin`
|
|
- Log Out -> `/logout`
|
|
- Site name/header -> `/`
|
|
|
|
Journal-context navigation is intentionally not changed.
|
|
|
|
## Required `.htaccess` aliases
|
|
|
|
Place these rules **before** the generic OJS catch-all rewrite rule:
|
|
|
|
```apache
|
|
RewriteRule ^dashboard/?$ index.php/index/id/index [L,QSA]
|
|
RewriteRule ^profile/?$ index.php/index/id/user/profile [L,QSA]
|
|
RewriteRule ^admin/?$ index.php/index/id/admin/index [L,QSA]
|
|
RewriteRule ^logout/?$ index.php/index/id/login/signOut [L,QSA]
|
|
```
|
|
|
|
Then keep the existing OJS rules, for example:
|
|
|
|
```apache
|
|
RewriteCond %{REQUEST_FILENAME} !-f
|
|
RewriteCond %{REQUEST_FILENAME} !-d
|
|
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
|
|
```
|
|
|
|
If the configured site locale/path is changed from `id`, update the internal targets above accordingly.
|
|
|
|
## Install
|
|
|
|
Upload the ZIP from **Site Settings -> Plugins -> Upload A New Plugin**, then enable **Clean User URLs**.
|
|
|
|
If the plugin cannot be uploaded from the UI, extract `cleanUserUrls` into `plugins/generic/` and enable it from the plugin list.
|
|
|
|
|
|
## 1.0.0.2
|
|
Fix output-filter callback compatibility with Smarty in OJS 3.5.0-5.
|
|
|
|
|
|
## 1.0.0.4
|
|
Adds a conservative clean URL for the exact site-level **Administration** breadcrumb/home link:
|
|
|
|
- `/index/id/admin` -> `/admin`
|
|
- `/index/id/admin/index` -> `/admin`
|
|
|
|
It deliberately does **not** rewrite child admin URLs such as `/index/id/admin/settings`,
|
|
component (`$$$call$$$`) routes, API routes, or AJAX endpoints.
|
|
|
|
|
|
## 1.0.0.5
|
|
Fixes the Administration-link matching bug in v1.0.0.4 and cleans ordinary
|
|
site-level Administration URLs while leaving component/API/AJAX routes alone.
|
|
|
|
Requires Apache aliases such as:
|
|
`/admin/contexts -> index.php/index/id/admin/contexts`.
|
|
|
|
|
|
## 1.0.0.6
|
|
Adds clean ordinary site-level user URLs.
|
|
|
|
Examples:
|
|
- `/index/id/user/profile` -> `/user/profile`
|
|
- `/index/id/user/register` -> `/user/register`
|
|
|
|
Requires:
|
|
`RewriteRule ^user/(.*)$ index.php/index/id/user/$1 [L,QSA]`
|
|
|
|
Component/AJAX (`$$$call$$$`) and API routes remain untouched.
|
|
|
|
|
|
## 1.0.0.7
|
|
Fixes the backend **Edit Profile** link in OJS 3.5.
|
|
|
|
The backend top navigation is rendered by Vue after Smarty output filters run,
|
|
so the plugin now adds a small backend-only MutationObserver that changes only:
|
|
|
|
- `/index/id/user/profile` -> `/user/profile`
|
|
|
|
No API, component (`$$$call$$$`), journal-context, or profile-tab routes are modified.
|
|
|
|
|
|
## 1.0.0.8
|
|
Extends the backend Vue user-menu helper to clean both:
|
|
|
|
- `/index/id/user/profile` -> `/user/profile`
|
|
- `/index/id/login/signOut` -> `/logout`
|
|
|
|
No API, component (`$$$call$$$`), profile-tab, or journal-context routes are modified.
|