Drupal: .htaccess Access Deny
August 21, 2014 – 7:59 am | No Comment

In this article I will tell how to forbid access to certain resources for some clients. The instructions will include descriptions of different directives.

Read the full story »
CSS Templates

Contain reviews and news about CSS Templates.

Freebies

Contain freebies such as icons, graphics, headers and images for your websites.

Fun Stuff

Contains other fun stuff for entertainment or interesting site showcase.

How-To

Contain technical elaborations on some specific workarounds or common tweak.

Joomla Templates

Contains reviews and news about Joomla templates.

Home » How-To

Drupal: How To Unset Clean URLs

Submitted by on September 14, 2010 – 9:03 amOne Comment

It may occur that Drupal-based site previously working with clean URLs stop working and all content is unavailable. These are the possible reasons:

  • Moving datbase to other server,
  • Restoring site copy from server on a local PC,
  • Restoring from backup,
  • Disappearing of .htaccess file,
  • Hoster personnel (or you) makes some changes in web-server settings..

So you need to unset clean URLs on your site.

Solutions:

  • Accessing the site via non-clear URLs
  • Using of SQL-snippet for disabling clean URLs
  • Unsetting clean URLs in settings.php

Accessing the site via non-clear URLs

  1. Open http://example.com/?q=user
  2. Login as admin (links still will not work)
  3. Open http://example.com/?q=admin/settings/clean-urls (DRUPAL 5,6) and unset clean URLs on settings page.

Links should now work.

Using of SQL-snippet for disabling clean URLs

Execute SQL-snippet:

UPDATE variable SET value = ‘s:1:”0″;’ WHERE name = ‘clean_url';
DELETE FROM cache;

Unsetting clean URLs in settings.php

In the settings file of the required site (domain), insert this string to redefine a variable:

$conf[‘clean_url’] = 0;

Good Luck!

One Comment »

  • Ted Stein says:

    Thanks, but it didn’t work for me. In the SQL, you have back-ticks where you need quotes.

    This worked for me:

    UPDATE variable SET value = "s:1:”0″;" WHERE name = "clean_url";

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.