Mod rewrite .htaccess用于Kohana V3中的多个应用程序

Mod rewrite .htaccess用于Kohana V3中的多个应用程序,mod-rewrite,kohana-3,Mod Rewrite,Kohana 3,您好,我在Kohana v3中安装了多个应用程序,它在不启用.htaccess的情况下正常工作(删除index.php或admin.php) 我的设置 + system/ + modules/ + applications/ + public/ + bootstrap.php + ... + admin/ + bootstrap.php + ... + index.php (for 'public' application) + admin.php (fo

您好,我在Kohana v3中安装了多个应用程序,它在不启用.htaccess的情况下正常工作(删除index.php或admin.php)

我的设置

+ system/ + modules/ + applications/ + public/ + bootstrap.php + ... + admin/ + bootstrap.php + ... + index.php (for 'public' application) + admin.php (for 'admin' application) +系统/ +模块/ +应用程序/ +公开的/ +bootstrap.php + ... +管理员/ +bootstrap.php + ... +index.php(用于“公共”应用程序) +admin.php(用于“admin”应用程序) 因此访问前端示例url将是:

http://mydomain.com/index.php/(controller_name)/... http://mydomain.com/index.php/(控制器名称)/。。。 以及访问管理站点

http://mydomain.com/admin.php/(controller_name)/... http://mydomain.com/admin.php/(控制器名称)/。。。 任务是,我想删除index.php(默认url)和admin.php,并将其替换为/admin/using.htaccess(mod_rewrite),以便

http://mydomain.com/(controller_name) <- 'public' application http://mydomain.com/admin/(controller_name) <- 'admin' application
http://mydomain.com/(controller_name)通常RewriteBase参数是“/”而不是“/ko3/”——它是webroot中的一个文件夹名。还要检查Web服务器的配置以获得modrewrite支持。

/ko3/是服务器中的文档根目录。。忽略这一点。我需要关于RewriteCond/RewriteRuleold-StyleURL(
http://mydomain.com/admin.php/(控制器名称)/…
)仍在工作?是的,仍在工作。我需要重写admin.php=>admin并将所有其他内容重定向到index.php/>/ko3/是我在服务器中的文档根目录。但它不是webroot下的文件夹(正如我在安装方案中看到的)。将其更改为“/”。
# Catch every request for admin 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all URLs to admin.php/URL
RewriteRule ^admin/(.*) admin.php/$1 [PT,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT,L]
# Catch every request for admin 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all URLs to admin.php/URL
RewriteRule ^admin/(.*) admin.php/$1 [PT,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT,L]