Community Documentation

How do I unset the clean URLs?

Last updated March 18, 2011. Created by dman on February 2, 2004.
Edited by mr.baileys, jonhattan, jwuk, greggles. Log in to edit this page.

It's possible that a Drupal site that was once configured to run with clean URLs later on stops doing so. After that, almost all content is inaccessible, because the paths being generated are not supported by the hosting platform.

This occasionally happens

  • after transferring databases between hosts,
  • taking a local copy,
  • restoring from a backup (and leaving the .htaccess behind),
  • deleting the .htaccess,
  • or even from your host (or you) making inadvertant security changes.

The problem is that you cannot set it back, because you cannot browse to the specific configuration page anymore.
Drupal checks once if clean URLs are supported before allowing you to enable them, then assumes that things will continue working.

The simplest way to resolve this is by entering the 'unclean' system paths directly.

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 0 --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).

Comments

Drupal 7

Easy Step

yoursite.com/?q=admin/config/search/clean-urls

I have site90.net it broke my site when i tried clean urls.

To Login first...

Use firebug to change the URL in the form tag.

Change it to:

<form ... action=?q=node&destination=node>

Then browse to..
?q=admin/config/search/clean-urls

Thank you

Thanks to User "Moro" ! Used the link you provided for drupal 7 and disabled clean urls from there. Only wish I'ld read this earlier, would have saved me 3 days of stress. Thanks for your comment.

www.shekinahinvestlimited.com
Website Design & Development | Online Marketing | Consultation

About this page

Drupal version
Drupal 4.5.x or older, Drupal 4.6.x, Drupal 4.7.x, Drupal 5.x, Drupal 6.x
Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.
nobody click here