0
这是一个Apache .htaccess问题。带有Kohana PHP框架的URL中的连字符
在Kohana的PHP框架(我是3.1),它不会出现,他们支持连字符的URL的控制器或动作,这是域后的第2个URL参数,如:
http://example.com/controller/action
OR
http://example.com/blogs/edit-article
有没有一种办法可以让我的.htaccess文件,这样我可以剥夺连字符(破折号)从控制器和动作插槽,而不是其他SLO TS?这是我目前的.htaccess文件:
Options All +FollowSymLinks -Indexes -Multiviews
# Turn on URL rewriting
RewriteEngine On
# Installation directory
RewriteBase/
# Protect hidden files from being viewed
<Files .*>
Order Deny,Allow
Deny From All
</Files>
RewriteRule ^assets/(.*)$ application/views/assets/$1
RewriteCond %{REQUEST_FILENAME} !/application/views/assets/.*
# 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]
另请参阅http://stackoverflow.com/questions/7404646#answer-8751122 – ChrisV 2012-10-14 16:42:58