OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Shorter URLs configuration and rewrite

Are you responsible for making OMP work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, michael, asmecher

Forum rules
What to do if you have a technical problem with OMP:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OMP Discussion subforum; if you have a development question, try the OMP Development subforum.

Shorter URLs configuration and rewrite

Postby stefan » Sun Apr 21, 2013 12:45 am

Hi,

We now have an OMP instance running at:

http://langsci-press.org/omp/index.php/LangSci-Press/

What I would like is the following URL:

http://langsci-press.org/

So, I would like to remove all of /omp/index.php/LangSci-Press/. The OJS-FAQ mentions things to do, but the config.inc of OMP does not contain the things that are mentioned in the OJS FAQ. So how could I achive this without breaking OMP?

Thanks

Stefan
stefan
 
Posts: 81
Joined: Wed Feb 06, 2013 1:49 pm

Re: Shorter URLs configuration and rewrite

Postby asmecher » Mon Apr 22, 2013 8:19 am

Hi Stefan,

OJS and OMP share the same router code, so the procedure with OMP will be exactly the same as the one for OJS. Let me know what configuration items you're having trouble with and I'll guide you through the setup process. (However, mod_rewrite rules can be tricky and you may need to do some homework there.)

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7710
Joined: Wed Aug 10, 2005 12:56 pm

Re: Shorter URLs configuration and rewrite

Postby Garant » Wed Mar 26, 2014 2:18 am

Hi!
I'd bump this thread!
Recently we have installed the OMP and started to study and configure it :)
I've found this code in the forum and placed it in .htaccess file

Code: Select all
<IfModule mod_rewrite.c>
   RewriteEngine On

   RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
   RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f

   RewriteRule ^/omp(.*)$ /index.php/omp$1 [L]

   RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
   RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f

   RewriteRule ^/(.*)$ /index.php/index/$1 [QSA,L]
</IfModule>


But the accessed URL doesn't get shorten.
For example the login URL is: https://domain/omp/index.php/index/login

We'd to wipe out the "/index.php/index/"

The config.inc.php is pretty simple:
Code: Select all
base_url = "https://domain/omp"
disable_path_info = Off
allow_url_fopen = Off
force_ssl = Off
force_login_ssl = Off
Garant
 
Posts: 192
Joined: Wed May 30, 2012 8:53 am

Re: Shorter URLs configuration and rewrite

Postby JasonNugent » Wed Mar 26, 2014 5:15 am

Hi Garant,

Is mod_rewrite and/or .htaccess files enabled on your server? The configuration directives won't work unless those things are turned on.

Regards
Jason
JasonNugent
Site Admin
 
Posts: 791
Joined: Tue Jan 10, 2006 6:20 am

Re: Shorter URLs configuration and rewrite

Postby Garant » Wed Mar 26, 2014 6:35 am

Hi Jason!
The phpinfo shows the mod_rewrite in "Loaded modules" list. So, as I understand it's turned on.
The .htaccess is enabled
Garant
 
Posts: 192
Joined: Wed May 30, 2012 8:53 am

Re: Shorter URLs configuration and rewrite

Postby Garant » Mon Mar 31, 2014 7:07 am

It was necessary to change this line:
Code: Select all
RewriteRule ^/omp(.*)$ /index.php/omp$1 [L]

to
Code: Select all
RewriteRule ^(monograph's_name_here)(.*)$ /omp/index.php/$1$2 [L]

And add this line to the config.php:
Code: Select all
base_url[monograph's_name_here] = "https://www3.mruni.eu/omp/monograph's_name_here"
Garant
 
Posts: 192
Joined: Wed May 30, 2012 8:53 am

Re: Shorter URLs configuration and rewrite

Postby asmecher » Mon Mar 31, 2014 7:17 am

Hi Garant,

Just to clarify -- you mean the press's name, not the monograph's name, correct?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7710
Joined: Wed Aug 10, 2005 12:56 pm

Re: Shorter URLs configuration and rewrite

Postby Garant » Mon Mar 31, 2014 7:18 am

Hi Alec, it's "Press Initials" in my case
Garant
 
Posts: 192
Joined: Wed May 30, 2012 8:53 am

Re: Shorter URLs configuration and rewrite

Postby asmecher » Mon Mar 31, 2014 8:13 am

Hi Garant,

This is actually the press's "path" field, which may (in many cases) be configured with the same value as the press initials.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7710
Joined: Wed Aug 10, 2005 12:56 pm


Return to OMP Technical Support

Who is online

Users browsing this forum: No registered users and 0 guests