Last updated June 1, 2010. Created by criznach on February 29, 2008.
Edited by mr.baileys. Log in to edit this page.
Narrow the problem
The most likely cause is misconfiguration of mod_rewrite or clean URLs on the new server. Confirm this by short-circuiting the clean URL system and requesting pages directly, like this:
http://www.example.com/index.php?q=user
If the login page is shown, then you can assume that Drupal's page serving mechanism is working properly, but mod_rewrite isn't working. To determine if mod_rewrite is enabled, create a file called phpinfo.php in the root of your site. This file should be accessible from a web browser and contain this code:
<?php
phpinfo();
?>Ensure that mod_rewrite is enabled
Navigate to phpinfo.php in a browser like this: http://www.example.com/phpinfo.php
On that page, look for a section called "Loaded Modules" and check that mod_rewrite is included. If not, mod_rewrite is not being loaded by apache and will need to be enabled. The process will be different depending on the server platform and apache build. Keep the phpinfo.php file for now - it will be helpful later.
Ensure that Drupal's .htaccess file is being used
Once it's been confirmed that mod_rewrite is enabled, double check that Drupal's .htaccess file is in the site's root, and that it is working. Confirm that .htaccess is enabled by temporarily replacing Drupal's .htaccess file. Make a backup of the existing .htaccess and create one like this...
DirectoryIndex phpinfo.phpNow try the site URL without specifing a page or file in a web browser: http://www.example.com/. If you see PHP's phpinfo dump, the .htaccess file worked and you can restore the old one. If not, the server may not be allowing .htaccess overrides for your site.
Double check your rewrite_base setting
If phpinfo was displayed, something may be misconfigured in the existing Drupal .htaccess file. Check the documentation for "RewriteBase" and "RewriteEngine" settings.
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
Enable necessary .htaccess overrides
If phpinfo was not displayed, locate your apache configuration file and enable the necessary .htaccess overrides. This location will vary by server platform, so check the appropriate documentation. In this example (Ubuntu server), the default apache vhost configuration was located at:
/etc/apache2/sites-enabled/000-default
To configure mod_rewrite from .htaccess, the apache config needs to allow at minimum "FileInfo" overrides. In order to make the simple DirectoryIndex test work, apache needs to allow "Index" overrides. Locate the section in the apache configuration file or included vhost configuration file that looks like this:
<Directory /filesystem/path/to/your/sites/root>
</Directory>Within that block, either add or edit the apache AllowOverride directive. This can create security risks, so see the official reference here:
http://httpd.apache.org/docs/1.3/mod/core.html#allowoverride
To allow all overrides, it will look like this:
<Directory /filesystem/path/to/your/sites/root>
AllowOverride All
</Directory>To only allow selected overrides, specify them individually like this:
<Directory /filesystem/path/to/your/sites/root>
AllowOverride Indexes Options FileInfo
</Directory>Now reload the apache configuration. This is also different by platform, so consult the appropriate documentation. On Ubuntu server the command is:
# /etc/init.d/apache2 reloadNavigate a browser to http://www.example.com/ and PHP's phpinfo should be displayed. If so, replace it with Drupal's .htaccess file and your site should now be working as expected.
If clean URLs are still not working, go back to the section titled Double check your rewrite_base setting.
Comments
Temporary URL Issues
If you are using a temporary URL such as 192.168.0.42/~username because the domain has not been transferred yet or has not propagated yet, you would have the problem described above until the domain name is transferred over.
To be able to use Drupal before the domain name points over, you will need to change something in the .htaccess file:
# Modify the RewriteBase if you are using Drupal in a subdirectory or in a# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /drupal
If your temporary URL is something like 192.168.0.42/~username then you will need to add the following line in .htaccess:
RewriteBase /~usernameOnce you point the domain name over to the website, be sure to comment out or delete that line.
Hope that helps.
--
Scott M. Stolz
http://www.wistex.com/
http://www.cardservicenet.com/
--
Scott M. Stolz
http://www.wistex.com/
Page not found after update from 6.10 to 6.12
After updating from 6.10 to 6.12, all my pages return a 'page not found' error, except my admin and front-end homepage.
I spent many hours figuring out what caused this, but at the end, it was a silly mistake I made myself (as usual).
I did not backup the .htaccess file since I though I had not changed this, but of course I had to comment out the 'Options -Indexes' and 'Options +FollowSymLinks'.
Hope this is helpful for anybody who might be as stupid as me.
Don't try.
I had this problem and both
I had this problem and both checks passed.
1. Ensure that mod_rewrite is enabled
2. Ensure that Drupal's .htaccess file is being used
The way I solved the problem was to add the following to my httpd.conf and restarted apache.
<Directory /filesystem/path/to/your/sites/root>
AllowOverride All
</Directory>
restart apache
/etc/init.d/httpd restart
shared hosting. my hosting
shared hosting. my hosting provider dont want to enable mod_rewrite. any solution to this?
belajar drupal, makan drupal, tidur drupal
i get the solution at 3 am.
i get the solution at 3 am. just disable clear URL. its bad for SEO but thats the only way.
belajar drupal, makan drupal, tidur drupal