目前,使用Kohana的3.1,我可以通过访问我的控制器:如何从网址中的Kohana删除的index.php 3.1
http://localhost/kohana/index.php/admin
不过,我想访问它们没有“的index.php “在中间,如:
我怎么能这样做?我是否需要更改我的.htaccess文件或某些配置选项?
我使用提供的Kohana中的.htaccess:
# Turn on URL rewriting RewriteEngine On # Installation directory RewriteBase/ # Protect hidden files from being viewed Order Deny,Allow Deny From All # Protect application and system files from being viewed RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L] # Allow any files or directories that exist to be displayed directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # Rewrite all other URLs to index.php/URL RewriteRule .* index.php/$0 [PT]
完美!本地主机上的任何人都应该注意,base_url或htaccess中不需要“localhost”。 (kohana 3.2对我来说) – 2012-04-26 03:59:46