RewriteRule of .htaccess not aliasing the url


I have an OJS 3.101 instaled with 2 domains name, for example:

For the portal i have:
For the Journal i have :

My .htaccess basicaly is:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{HTTP_HOST} ^$ [NC,OR]
RewriteCond %{HTTP_HOST} ^$ [NC]
RewriteRule ^(.*){REQUEST_URI} [R=301,NC]

The problem:

When i type it goes to, as expected, but i need it to keep the url at the browser…

IF i add the [P] flag at [R=301,NC,P], i got the right url at the browser (, but the site shows the content…

Before i went nuts inside the .htaccess i tried the restful_urls way. And the OJS keep showing the unformated version of the page…

Is there a way that I can solve this problem inside the .htaccess?

Thks a lot

R.I.P Stan Lee

1 Like

Saying “i need it to keep the url at the browser” suggests that you are not wanting to redirect the browser, but rather rewrite the request.

These are two distinct operations. In the example code you provided you are redirecting the web browser with any request to, telling the browser to go to instead.

To perform a rewrite of the request would be to have your server provide the content for one URI path via another URI path. This is want typically happens with the RESTful URLs configuration. For example, a request comes in for “/ojs/myjournal/index”, which doesn’t actually exist, so it is re-written as “/ojs/index.php/myjournal/index”, which passes parameters of “myjournal/index” to the “/ojs/index.php” script.

Thanks a lot @ctgraham

When i put the restful_url = On all my css were not loaded. My page become unformated. Total caos.

If you may take a look, these are my (client’s) real sites.

the portal: → goes to
the journal: → goes to

Is there a way that i can keep the (url) without turning the restful_url On?

Sorry to bother you

The most straightforward way to manage multiple domains is by using multiple virtual hosts in your Apache configuration. If you only have access to the Apache configuration via .htaccess, you will need to setup multiple re-write rules. This can be configured with or without restful URLs.

There is a fairly extensive discussion on multiple domains here:

Do be aware, however, that this will require mastery of Apache’s mod_rewrite directives and it is one of the more complex server administration topics discussed here.