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