The question mark in the URL for PHP variables causes the link to break. Any idea why?

I do not know what has changed in the past - this was used to work:

Accessing the url on my server as shown below does not work: http://www.domain.com/folder/file.php?variable=a&variable2=b

I get "Not Found. The requested address 406.shtml was not found on this server." message.

However, if I access this, it works: http://www.domain.com/folder/file.php

Adding a question mark after file.php is what makes it break. I have never had such a problem before. At first I thought that .htaccess had something to do with it, but I know that it has not been edited at all in the past.

Any ideas? I use CakePHP, but I doubt it has anything to do with it; it already worked. All suggestions are welcome!

EDIT: The file /app/webroot.htaccess has the following:

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

</IfModule>

As far as I know, this hasn't changed at all, and the URL worked with that. The .htaccess file directly below / public_html / contains the following:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
<IfModule mod_rewrite.c>
   RewriteEngine on


   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]


</IfModule>
+3
source share
2 answers

You have an error in apache configuration. He tries to give you a 406 error page, but cannot find it. If you fix this, you may get a more informative error.

This link may help you with the root of the problem: http://urbangiraffe.com/2005/08/20/mysterious-406-error/

mod_security. , -.

+1

99,9% , htaccess. - , .

0

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


All Articles