Hi I have setup multiple application in Kohana v3, it works normally without enabling .htaccess (to remove index.php or admin.php)
my setup
+ system/
+ modules/
+ applications/
  + public/
    + bootstrap.php
    + .开发者_StackOverflow..
  + admin/
    + bootstrap.php
    + ...
+ index.php (for 'public' application)
+ admin.php (for 'admin' application)
so to access the frontend sample url will be;
http://mydomain.com/index.php/(controller_name)/...
and to access administration site;
http://mydomain.com/admin.php/(controller_name)/...
The task is, I want to remove and replace index.php (default url) and admin.php with /admin/ using .htaccess (mod_rewrite) so it can be
http://mydomain.com/(controller_name) <- 'public' application http://mydomain.com/admin/(controller_name) <- 'admin' application
my current .htaccess (not working) is;
# Turn on URL rewriting
RewriteEngine On
# Installation directory
RewriteBase /ko3/
# Protect hidden files from being viewed
    Order Deny,Allow
    Deny From All
# Protect application and system files from being viewed
RewriteRule ^(?:web-apps|modules|core)\b.* index.php/$0 [L]
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# TODO: rewrite admin URL to admin.php/URL
#RewriteRule ^admin/(.*) admin.php/$0 [L]
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT]
Usually RewriteBase param is '/' instead of '/ko3/' - its a folder name in your webroot. Also check webserver's configuration for modrewrite support.
# 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]
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论