开发者

Question mark in URL for PHP variables makes the link broken. Any idea why?

I don't know what changed in the past--this used to work:

Accessing a URL on my server like the following, doesn't work: http://www.domain.com/folder/file.php?variable=a&variable2=b

I'm getting a "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 the question mark after file.php is what makes it break. I have never experienced a problem like this before. At first I thought that .hta开发者_C百科ccess had something to do with it, but I know as a fact that it hasn't been edited at all in the past.

Any ideas? I'm using CakePHP, but I doubt that has anything to do with it; this has worked before. All suggestions are welcome!

EDIT: The /app/webroot .htaccess file has this:

<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 this. The .htaccess file right under /public_html/ contains this:

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>


You've got an error in your apache config. It's attempting to give you the 406 error page, but can't find it. If you fix that 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/

It could also be caused by mod_security. If it's not your server you should ask your hosting provider.


99.9% probability that this is being caused by a change in your htaccess file. Something is checking for a query string and redirecting to or trying to load a file that doesn't exist.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜