OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



how to redirect my journal?

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, btbell, michael, bdgregg, barbarah, 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.

how to redirect my journal?

Postby dsanchez » Wed Nov 22, 2006 10:01 am

Hello everybody,

I have installed OJS in an address like this:

http://mysite.com/ojs

I have also created a "myjournal", which OJS address would be

http://mysite.com/ojs/index.php/myjournal

But I'd love to create a redirect

http://mysite.com/myjournal

that would show the content as if I was in:

http://mysite.com/ojs/index.php/myjournal

How can I make this possible?

Thanks

David.
dsanchez
 
Posts: 30
Joined: Thu Feb 09, 2006 3:42 pm

Postby asmecher » Wed Nov 22, 2006 10:56 am

Hi David,

You can accomplish this with a combination of Apache rewrite rules (mod_rewrite) and OJS configuration.

The rewrite rules will take incoming requests for the URL you want and map it to the URL OJS expects.

Then, when generating a response, OJS needs to be properly configured so that any URLs it generates are also of the form you want to use. You can configure this with the base_url directives in config.inc.php. Note that you'll probably need to enter a few base_url options to get this working. Once you get mod_rewrite configured, feel free to ask me for help with this.

I don't have any specific experience with Apache rewriting rules, but there is a lot of documentation and many examples online, and the rule you want to write should be fairly straight-forward. If you do manage to find a good rule, please post it here so that other users can use it as a reference.

FYI, you may be able to use mod_alias instead of mod_rewrite when configuring Apache; this is easier to configure but I can't guarantee it'll be able to mask the index.php part of the URL.

Regards,
Alec Smecher
Open Journal Systems Team
asmecher
 
Posts: 8470
Joined: Wed Aug 10, 2005 12:56 pm

Postby smitech » Tue Dec 19, 2006 6:34 pm

Just setting up a site on a shared host and needed to do the same thing ...

You can also hack this using html meta refresh. Look at your journal home page in your browser and copy the contents of the address bar. Add a directory named the name of the journal under the ojs directory. In it, put a file named index.html that contains this:

Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>YourJournalTitleGoesHere</title>
<meta http-equiv="REFRESH" content="0;url=PastedFromAddressBar">
</HEAD>
<BODY>
</BODY>
</HTML>


where PastedFromAddressBar is changed to what you copied from the address bar and YourJournalTitleGoesHere is changed to the title of your journal.

rm
SMITech.org
smitech
 
Posts: 22
Joined: Tue Dec 19, 2006 6:15 pm

Postby smitech » Wed Dec 20, 2006 2:21 pm

I'd be remise if I didn't point out that this hack can cause some search engine spidering mayhem. Last time I checked (and for practical purposes this was a while ago - anyone that has more recent experience may want to comment) Google would index the metadata on this empty page only, so what should be your journal home page wouldn't get much attention. The Google spider will get to the real content of your journal home page, but there could be some confusion in the indexes and the Google listings. On our site we prohibit spidering of these journal directories in robots.txt so Google only accesses the "real" home page of the journal.

rm
smitech
 
Posts: 22
Joined: Tue Dec 19, 2006 6:15 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: Google [Bot] and 2 guests