Zend Framework: Weird Rewriting URLs

I am experiencing strange behavior with my Zend Framework application.

I am running this url, hoping the index controller will trigger action 1234567890.

http://hello.com/index/1234567890?test=http%3A%2F%2Fworld.com%2Findex.php

However, I get an exception:

Message: Invalid controller specified (4567890) 

And strangely, all the URLs that are on the page now link to:

http://hello.com/index.php/index/1234567890

Instead:

http://hello.com/index/1234567890

Note that the index.php line, which is falsely entered in the URLs, has 9 characters, this is the same number as cutting the index / 123 line 4567890 to get the wrong controller name.

Another thing is that indexed index.php correlates with index.php in the url-encoded get parameter from the example.

What's wrong? Is this a bug in Zend? Or am I doing something wrong?

This is my .htaccess:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /index.php [NC,L]
+3
2

, , URL- . , , , modrewrite:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php

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

. , URL- , , Zend Framework, - filename modrewrite URL-.

, index.php main.php , , modrewrite, , , main.php URL- , .

, , index.php( ) main.php , , , modrewrite !

!

+3

MultiViews . :

Options -MultiViews
0

Source: https://habr.com/ru/post/1704460/


All Articles