Thursday, February 24, 2011

Drupal: How to enable Clean Urls Module

  1. Edit apache configuration
    ee /usr/local/etc/apache22/httpd.conf

    and set
    AllowOverride All

  2. Make sure
    LoadModule rewrite_module modules/mod_rewrite.so

    is enable.

  3. Edit .htaccess file and change

    # RewriteBase /

    to
    RewriteBase /

  4. Restart Server


Another way

If you have locked yourself out, visit http://example.com/?q=user just like you do to re-enable offline sites. You can log in there, enough to become admin, although none of the navigation will work yet.

Next, enter http://example.com/?q=admin/settings/clean-urls (in DRUPAL 5 and 6) to view the page where you can unset clean URLs.
Your interface will be usable again.

Other options that should get the same result include:

  • Run the drush commands:
    drush vset clean_url 1 --yes

  • Run the mysql commands:
    UPDATE variable SET value = 's:1:"0";' WHERE name = 'clean_url';
    DELETE FROM cache;

  • Alternatively, you can modify the appropriate settings.php file to include the line
    $conf['clean_url'] = 0;
    at the bottom (or similar code in the site settings array you'll see there).

    .

0 comments:

Post a Comment