非常奇怪的Drupal 7 404行为 [英] Very strange Drupal 7 404 behaviour
问题描述
这正在影响所有内容使用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屋!