模组重写OJS如何从URL中删除文件夹名称


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

>我有一个问题。我的 ojs 安装位于名为/ojs 的子文件夹中,而在根文件夹中有一个 joomla 站点:

www.my_web_site.com(乔姆拉)www.my_web_site.com/OJS (OJS

主题中描述的方法模组重写从URL中删除文件夹名称对我不起作用。

我的 OJS 安装只有一个问题,名为"我的问题"

所以问题主页网址是:http://www.my_web_site.com/ojs/index.php/myissue

我想要这个新的主页网址:http://www.my_web_site.com/myissue

我的.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

提前谢谢。

将此规则插入 DocumentRoot/.htaccess 就在 Joomla 路由规则之前

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