Drupal: How To Unset Clean URLs
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
- Open http://example.com/?q=user
- Login as admin (links still will not work)
- 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;
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";