OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki


could not get mod_rewrite to work

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

Moderators: jmacgreg, michael, jheckman, barbarah, btbell, bdgregg, asmecher

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

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 OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

could not get mod_rewrite to work

Postby newbies » Sat Feb 23, 2013 9:32 pm

I tried to find a solution in this forum in vain. There are posts but they are posted years ago.

I installed 2.4.1 under the root directory as /home/mydomain/www/ojs

my config url settings are as follows:
Code: Select all
base_url = "http://www.mydomain.org/ojs
base_url[index]= http://mydomain.org
base_url[journal] = http://www.mydomain.org/journal


my .htaccess file in root directory is this:
Code: Select all
#Options +FollowSymLinks
RewriteEngine On
RewriteBase /

# Use this set of 3 lines for each of your journals
RewriteCond %{SERVER_NAME} ^www.mydomain.org
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/journal/$1 [L]

# Use this set of 3 lines to allow access to the site level
RewriteCond %{SERVER_NAME} ^www.mydomain.org
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/index/$1 [L]


The URL setting in configure file seem to work, because I can see various links on the journal page has changed to expected format, for example, the link for journal ABOUT is http://www.mydomain.org/journal/about. The problem is when links are clicked, I received 500 error.

Could someone take a look at my code to see where the problem is? Thank you very much!
newbies
 
Posts: 2
Joined: Sat Feb 23, 2013 9:15 pm

Re: could not get mod_rewrite to work

Postby newbies » Tue Feb 26, 2013 1:24 am

I still need help, please!!

I check my Apache error log and found this for the 500 error:
Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary
newbies
 
Posts: 2
Joined: Sat Feb 23, 2013 9:15 pm

Re: could not get mod_rewrite to work

Postby asmecher » Tue Feb 26, 2013 9:36 am

Hi newbies,

This is an Apache configuration issue, not an OJS issue; I'd suggest trying stackoverflow.com or reading through these forums for more posts on the rewrite subject. Unfortunately we can't help with debugging mod_rewrite rulesets.

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

Re: could not get mod_rewrite to work

Postby Garant » Wed Jun 05, 2013 11:14 am

Hello!
I don't know to which topic to write so I will post my question here.
In Site administrator's area -> Hosted Journals we can configure path to each journal.
But this path is common for multilanguage journals. From SEO side the best approach is to have different journal's name in different languages (it will affect actual journal's URL).
So this is impossible to configure through OJS system.
But is there a way to make it with mod_rewrite or .htaccess?
Maybe it was already discussed?
Thank you!
Garant
 
Posts: 97
Joined: Wed May 30, 2012 8:53 am

Re: could not get mod_rewrite to work

Postby Garant » Fri Jun 07, 2013 10:26 am

Hi!
I've very low experience with mod_rewrite. Searching through forums I've found this example:

The main path to one of the journals is:
https://www3.domain.net/ojs/intellectual-economics/
Once the locale has been changed I'd like to change to URL address to corresponding translation.
For example Lt locale should look like this:
https://www3.domain.net/ojs/intelektine-ekonomika/
But this rule doesn't work...
Code: Select all
RewriteCond %{HTTP_COOKIE} ^.*user/setLocale=lt_LT.*$ [NC]
RewriteRule /?ojs/intellectual-economics ojs/intelektine-ekonomika [QSA,L]

Am I doing something wrong or first line doesn't accept the param?
Maybe, someone who is more experienced could help me with this?
Garant
 
Posts: 97
Joined: Wed May 30, 2012 8:53 am


Return to OJS Technical Support

Who is online

Users browsing this forum: No registered users and 2 guests