开发者

how should my .htaccess file look like so it ignores js files?

I didn't know there was something funny with it until I tried to inject a js file into a view with this:

$this->headScript()->appendFile($this->baseUrl('/js/planilla.js'));
echo $this->headScript();

Now, I'm using the Zend Framework and there's no problem when I do the same thing with any css file within the /public/css folder so I really don't nknow what the problem might be. The js folder and js file DO EXIST, and when I try to just access it (http://domain.local/js/planilla.js) through the browser I get the following error message:

Exception information:

Message: Invalid controller specified (js) Stack trace:

0 /home/fiodorovich/library/ZendFramework/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))

1 /home/fiodorovich/library/ZendFramework/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()

2 /home/fiodorovich/library/ZendFramework/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()

3 /home/fiodorovich/public_html/gisele/public/index.php(26): Zend_Application-开发者_StackOverflow中文版>run()

4 {main}

Request Parameters:

array ( 'controller' => 'js', 'action' => 'planilla.js', 'module' => 'default', )

Right now my .htaccess looks like this:

SetEnv APPLICATION_ENV development
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_URI} (^.*/gisele.local/.*)$  [NC]
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

Any help whatsoever will be welcomed and thud, thanks in advance...

EDIT: the vhost file

EDIT2: I got this thing to work.

I had to add this line to the application.ini file for it to work:

resources.frontController.params.useDefaultControllerAlways = 1


The line

RewriteCond %{REQUEST_URI} (^.*/gisele.local/.*)$  [NC]

looks suspicious. Try to comment it. My .htaccess file looks like this. And it is absolutably workable.

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]

RewriteRule ^(.*)$ index.php [NC,L,QSA]


Your .htaccess is fine. Try http://domain.local/js/ and check if your files are still there.

The zend framework is taking your js directory as a controller so, is "js" inside your public directory as css? you could also try this to make sure.

RewriteRule ^js(.*)$ – [NC,L]

or could be your enviroment settings. let me know what happens.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜