Rewrite problem, /controller/action instead of /folder/file.php
I have a script of calling KCFinder.
window.open('/kcfinder/browse.php?type=files', ...);
it must open a window which contains KCFinder, but when I click the "Browser" button, it generatates error:
"Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (kcfinder)' in /home/vhosts/vonline_admin/library/Zend/Controller/Dispatcher/Standard.php on line 248"
I understand this error. It says that controller "kcfinder not found", but kcfinder doesn't require a controller, it's simply a path. Strangely, I run the website successfully in local but when I put it on hosting, it failed.
I think it is related to rewrite problem or routing but I don't know how to fix it.
Vhost: /usr/local/apache2/conf/vhosts/something_admin.conf
ServerName admin.something.com
ServerAdmin foo@boo.com DocumentRoot /home/vhosts/somethin开发者_高级运维g_admin/www SetEnv APPLICATION_ENV development TraceEnable off <Directory /home/vhosts/something_admin/www> Options -Indexes -Includes -ExecCGI -FollowSymLinks AllowOverride None </Directory> RewriteEngine on RewriteRule !\.(js|ico|gif|jpg|png|css|swf|txt|htm|html|xml)$
/index.php
.htaccess in www:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L]
The only difference I can see between your htaccess file and mine is in the RewriteRules; I have an asterisk:
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
精彩评论