Google
 
 
Home

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
SnortShorwall - Using Snort And Shorewall Together
Shorewall Router on Linux
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 14089 Members   Members (14089) # Online
 We have 6 Guests Online. Guests 6
 We have 0 Users Online. Users 0

Online Users
No Users Online

Statistics
OS: Linux w
PHP: 5.2.17
MySQL: 5.1.56
Time: 10:05
Members: 14089
Hits: 1789881
News: 281
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
Man, this saved my life.
Written by Guest on 2009-04-02 21:13:12
Thank you.

Only registered users can write comments.
Please login or register.

Powered by AkoComment 1.0 beta 2!




 


 

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