302 redirect on single hosted journal

Hi

I need to temporary change http header 302 to something else…

On single hosted journal, when we open our main domain it will 302 redirected into hosted journal path

Site.com >>302 >> site.com/index.php/journal

In which file does this status header is controlled?

Thank you

No one know which file responsible for the redirect?

Hi @Andorejr

It’s recommend to make this redirection using the webserver host config files. It would be easier and you wouldn’t need to tweak OJS core.
If you host your journal using apache, you should create a .htaccess file in your www root folder adding the following:

RewriteEngine on
RewriteCond %{REQUEST_URI} ^/$
RewriteRule (.*) http://anotherdomain.com [R=301]

That should work.

You can still tweak OJS editing the OJS_root_folder/index.php file and adding a Location function at second line of the file, e.g.:

$ vi index.php

<?php
header("Location: https://www.anotherdomain/", true, 301);

exit;

You can still use 302 temp code or any other 30x you need.

Best,
Israel

Code above causing redirect loop (editing index.php)…and for htaccess, im not trying to redirect to another domain

Could you please give an example of the redirection that you would like to implement?

On single hosted journal(not multiple one) if we enter our main domain let say domain.com into browser url address bar

Main domain will redirected to let say domain.com/index.php/journal1

The redirect header is 302 …i want to know which configuration or file in ojs handle this 302 status header

I put code mention above on htaccess , but I got redirect loop