Rewriting URL to subdomain

Dear friends,

I have installed OJS 2.4.7-1 to www.website.com/ojs and hosting a “journal1”.
I turned on the Restful URL in config.file and added following code to .htaccess.

<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,L] </IfModule>

It seems that Restful URLs works fine. Thus my journal1’s URL became www.website/ojs/journal1. I am glad that there is no any "index.php"s in URL.

Now, I want to set my base ojs URL to a subdomain as ojs.website.com. And I want to transform my journal1’s URL into ojs.website.com/journal1.

How to do it? Any idea?

1 Like

To do this, your subdomain’s document root should point to the “ojs” folder itself.

To move the URL from the www to the new ojs subdomain, just move the files from the “ojs” directory to the subdomain’s document root.

If you want to keep both URLs (www.website.com/ojs/ and ojs.website.com) you might try a symbolic link in a Linux environment. Beware however that this might not work out-of-the box with OJS’s built-in caching.

1 Like

Hi @ctgraham,

Thanks for your answer. I already have created the subdomain, and pointed it to the ojs directory. But ojs.website.com does not work for me. Still my journal appears on www.website.com/ojs

The little I can see of your setup looks ok.

What error do you get when you try to access the ojs subdomain?

@ctgraham, I do not get any errors, when I type ojs.website.com it was redirecting to www.website.com. But today I SOLVED the issue. I recognize that it happens due to preserved browser (chrome) cache. When I cleared browser cache, the ojs.website.com has started to work.

1 Like