非常奇怪的Drupal 7 404行为 [英] Very strange Drupal 7 404 behaviour

查看:180
本文介绍了非常奇怪的Drupal 7 404行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在D7中有一些非常奇怪的行为,我以前没见过。我将一个新的站点从我的开发机器迁移到一个测试机器,所以代码和数据库是一样的。在开机(Ubuntu 13.04,Apache,PHP 5.5.3)上,一切正常,但在Raspberry Pi上运行PHP 5.4.4的Raspberry Pi的测试框上,我在表单提交时似乎收到404错误。似乎发生的情况是,当您查看HTTP响应时,表单不会被处理并返回原始页面,但使用404状态代码。



这正在影响所有内容使用POST,包括登录。我通过使用Firefox的Web开发人员工具更改登录表单的action属性来指向/,但是其他许多事情都没有起作用,管理员菜单有时会消失。 p>

想到这可能是一个缓存问题,所以手动截断了所有的缓存表,但没有任何区别。似乎有一个不存在的临时文件夹的问题,所以我创建了一个它期待与777永久(因为我无法更改设置,因为表单提交将无法正常工作...)但这不是这个无论是。清理网址正常工作。



以前从未见过这样的事情。任何想法最感谢!

解决方案

这是一个似乎是这个问题的答案(取自OPer下面的评论问题):


我忘了启用mod_rewrite和mod_headers!我感到惊讶的是,如果没有这些URL,干净的URL就可以正常工作。我认为这是因为.htaccess点404到Drupal,然后解释所请求的URL并显示相应的页面,但当然Apache正在发送一个404标题。



I am having some very strange behaviour in D7 that I have not seen before. I have migrated a new site from my dev machine to a test machine, so code and DB are identical. On the dev machine (Ubuntu 13.04, Apache, PHP 5.5.3), everything works fine, but on the test box which is a Raspberry Pi running PHP 5.4.4 on Raspbian, I seem to get 404 errors on form submission. What seems to happen is that the form is not processed and the original page is returned but with a 404 status code when you look at the HTTP response.

This is affecting everything that uses POST, including login. I did manage to get it to log in by changing the 'action' attribute of the login form to point to '/' using Firefox's web developer tools, but lots of other things didn't work and the admin menu occasionally disappeared.

Thought it might be a caching issue so manually truncated all the cache tables but that made no difference. There appeared to be an issue with a non-existent temp folder so I created the one it was expecting with 777 perms (as I couldn't change the setting because form submission wouldn't work...) but it wasn't this either. Clean URLs are working fine.

Never seen anything like this before. Any ideas most appreciated!

解决方案

Here is what seems to be the answer to this question (taken from a comment from OPer below the question):

I'd forgotten to enable mod_rewrite and mod_headers! What I was amazed about was that clean URLs were working at all without them. I think this is because .htaccess points 404s to Drupal, which will then interpret the requested URL and show the appropriate page, but of course Apache is sending a 404 header.

这篇关于非常奇怪的Drupal 7 404行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆