One journal, two paths

We moved a (single) journal install to another place and did some changes. later on, we unfortunately noticed that we accidental changed the journal path. We now have links to articles with both /path1/ and /path2/ and I am looking for a code to redirect path2 to path1 so indexed urls will still be valid.

I tried with a .htaccess file ( have access to mod_rewrite), but can’t get that to work and likely don’t understand enough about that and how OJS redirects urls; though, since it’s a single journal install I am hoping it won’t be too difficult.

Code that doesn’t work:
Options +FollowSymLinks
RewriteEngine On
RedirectMatch 301 /path2(.*) /path1/$1

Thanks for your help!

1 Like

ah, I think this topic can be closed again as this does seem tot work:

RedirectMatch 301 index.php/path2(.*)$1

or are there better solutions?

That is a solid solution, as long as you continue to use index.php in your URLs (not turning on RESTful URLs). If you did turn on RESTful URLs, you would just need a small tweak to the new path.

Thanks! Will avoid changes for a while after this experience :slight_smile: , and have no objections against using index.php