Drupal_404 NOT FOUND error

情况是这样的,我从公司打包回来我的网站,到家里的虚拟机部署后

只能看到首页,点击其他任何链接都会导致404 NOT FOUND




解决方法:
第一步,运行 http://localhost/update.php,可能需要修改 /sites/default/settings.php 中的

$update_free_access = FALSE; 为 TRUE ;最后问题解决后记得改回来到FALSE;





第二步,到phpmyadmin中,运行SQL

UPDATE variable SET value = 's:1:"0"' WHERE name = 'clean_url';

If necessary clear the cache:

DELETE FROM cache;




OK,问题解决。

高兴的太早
http://localhost/drupal_fllcc/en/kyry  这样的简洁Clean URL 还是无法使用的
只能使用  http://localhost/drupal_fllcc/?q=en/node/34

明天晚上研究下

URL简洁链接的问题(Clean URLs



解决方法参考

Clean URLs for Ubuntu 10.04(主要的)

Clean URLs with Apache 2 on Ubuntu

Step 6: Configure clean URLs

首先,要保证www/yoursite目录下要有  .htaccess文件

从一台电脑打包后到另一台部署的过程中会丢失这个文件

可以到Drupal的标准程序包中,Copy一份过来

然后,

For Windows Server,只要更改Apache配置httpd.conf

LoadModule rewrite_module modules/mod_rewrite.so

重启Apache即可;


For Ubuntu Server 10.04, 需要 修改文件: /etc/apache2/sites-enabled/default
如果没有的话,试试: /etc/apache2/sites-enabled/000-default

sudo a2enmod rewrite

sudo nano /etc/apache2/sites-enabled/000-default

修改第 (line 7 和 line 11), "AllowOverride None" to "AllowOverride All".

保存。

Restart Apache
sudo /etc/init.d/apache2 restart





OK ,问题解决了。


网上看到的其他解决方法A:


"Page Not Found" error on ALL pages of Drupal website

Recently one of my sites was upgraded to Drupal 5.7 from 5.1 and I was get a 404 or page not found error on all pages of my website except the front page. How I solved this.

1. I ran update.php again. This fixed my navigation. But clean urls were not working.
2. I found that .htaccess was corrupted. I transfered it again. bingo! it worked.
3. Finally I enabled clean URLS from my admin panel.

For more information on this error visit http://drupal.org/node/262892

If this article was of any help consider supporting this site by visiting sponsor ads or donating.

网上看到的其他解决方法B:

在正常的环境下,Drupal有时候会莫名其妙的提示 The requested page could not be found ,即找不到页面的错误。


   首先打开站点include/menu.inc这个文件,用记事本打开,如下代码:

 

<?php
/**
* Execute the page callback associated with the current path
*/
function menu_execute_active_handler($path = NULL) {
  if (_menu_site_is_offline()) {
    return MENU_SITE_OFFLINE;
  }
  // Rebuild if we know it's needed, or if the menu masks are missing which
  // occurs rarely, likely due to a race condition of multiple rebuilds.
// if (variable_get('menu_rebuild_needed', FALSE) || !variable_get('menu_masks', array())) {
    menu_rebuild();//只保留这个函数。重新构建menu的函数
  //}//注销
?>


方法二:

去google时找到了老外的一个解决办法,原文如下:

If Drupal 6 runs into a fatal problem while calling hook_menu(), your site may get into a state where all page views (the front page, the administration page, the modules page, everything) will give a 404/"Page not found"/"The requested page could not be found" error.

You can revive your site by fixing the error that caused the menu rebuild failure and then loading /update.php and completing the upgrade process (even if there are no updates available for any of the modules on your site).

意思大概是你调用hook_menu(), 时和缓存发生冲突错误还是怎么的引起的,解决办法非常简单
你的drupal根目录下有个update.php,通过外部url来访问这个文件,比如我的http://yf.dms.com/update.php,打开后按照上面的提示点击‘下一步’然后点update即可,完成后再去看看你的管理页面,一切恢复正常了


网上看到的其他解决方法C:

http://drupal.org/node/51587

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值