mod-rewrite OJS How to remove folder name from url?

1.4k Views Asked by At

I have a problem. My ojs installation is in a subfolder called /ojs, while in root folder there is a joomla site:

www.my_web_site.com (Joomla) www.my_web_site.com/ojs (OJS)

Method described in topic mod-rewrite remove folder name from url doesn't work for me.

My OJS installation has only one issue, named "myissue"

So the issue homepage URL is: http://www.my_web_site.com/ojs/index.php/myissue

I want this new homepage URL : http://www.my_web_site.com/myissue

My .htaccess:

DirectoryIndex index.php

# Turn mod_rewrite on
RewriteEngine On
RewriteBase /ojs
RewriteRule ^admin(.*)$ index.php/index/admin$1 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

#RewriteRule ^(.*)$ index.php/$1 [L]
RewriteRule ^(.*)$ index.php/$1 [QSA,L]

My config.inc.php:

; The canonical URL to the OJS installation (excluding the trailing slash)
base_url = "http://www.my_web_site.com/ojs"

base_url[index] = http://www.my_web_site.com/ojs/
base_url[myJournal] = http://www.my_web_site.com/ojs/myissue/

restful_urls = On

Thanks in advance.

1

There are 1 best solutions below

5
On

Insert this rule in DocumentRoot/.htaccess Just before Joomla routing rule:

RewriteRule ^(myissue)/?$ /ojs/index.php/$1 [L,NC]