Google
 
 
Home arrow Other Articles arrow Fix 404 error when enabling Drupal clean urls

Main Menu
 Home
 Linux Articles
 FreeBSD Articles
 Apache Articles
 Perl Articles
 Other Articles
 Program Downloads
 Free Books
 News
 The Web Links
 Contact Us

Most Read
Automating SFTP using expect
FreeBSD PPTP VPN
Shorewall Router on Linux
SnortShorwall - Using Snort And Shorewall Together
Shorewall Stand Alone Firewall

Polls
Favorite Linux/BSD
Fedora
Mandrake
Debian
Slackware
Gentoo
Suse
FreeBSD
Other
  

Syndicate
Latest news direct to your desktop
RSS

Login Form
Username

Password

Remember me
Forgotten your password?
No account yet? Create one

Members Online
 Linux-BSD-Central Has a Total of 701 Members   Members (701) # Online
 We have 7 Guests Online. Guests 7
 We have 0 Users Online. Users 0

Online Users
No Users Online

Statistics
OS: Linux w
PHP: 5.2.9
MySQL: 5.0.91-community
Time: 14:38
Members: 701
Hits: 1324410
News: 277
WebLinks: 15



-->

Fix 404 error when enabling Drupal clean urls   PDF  Print  E-mail 
Contributed by Chad Brandt  
Saturday, 24 January 2009

Some modules in drupal require the clean urls to be enabled. I have found some issues with this on my mac as well as any other deployment where the drupal site is not the root website. The error you will see is a 404 'The requested URL was not found on this server'. There is an easy solution to fix this and get clean urls working with drupal.

Take these steps to fix this issue

1. Make sure apache has mod_rewrite enabled. Make sure you have this line in your httpd.conf and that it is not commented out. The httpd.conf file can be found in /etc/apache2 on Mac OSX and in /etc/httpd/conf on most Linux distributions.
LoadModule rewrite_module libexec/apache2/mod_rewrite.so



2. Make sure you website has permission set properly. On linux this will usually be in your httpd.conf file. On mac this will in in /etc/apache2/users/<username>.conf. The permissions should look like this
<Directory "/Users/cbrandt/Sites/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>


3. Fix the RewriteBase in your .htaccess file in the root of your drupal install. The default .htaccess that comes with drupal is assuming that the wesite will be the root context (eg www.yourdomain.com) but if you install it in something like www.yourdomain.com/~user/drupal then you will need to fix the .htaccess file
- find the line that says #RewriteBase /drupal
- uncomment this and change it to your root context. So for my example I would have
RewriteBase /~user/drupal

Save this file and retry your clean urls.

Comments

Write Comment
Name:Guest
Title:
BBCode:Web AddressEmail AddressBold TextItalic TextUnderlined TextQuoteCodeOpen ListList ItemClose List
Comment:



Powered by AkoComment 1.0 beta 2!




 
Google Ads



 

Check out TwistByte - The best mobile apps available For awesome Android and IPhone applications!!