I enabled clean URLs on Drupal 7 and they work fine, however, I can not log in (and its not because a password issue). Therefore I would like to disable clean urls, but as I can't do it through the admin, I'd like to know how I can do it through the database.

Thanks!

Comments

silkAdmin’s picture

Yeah i have the same problem

beesasoh’s picture

Let's say your site is example.com now that clean urls are not supported you should use example.com/?q=user this will lead you to the login page. Provide the right login details and then submit. Now you may get a page not found error because clean urls are still enabled but you have been logged in and your session is created so change the url to example.com/?q=admin/settings/clean-urls this will lead you to a page where you can disable clean Urls. You know what now you are good to go...

Hope this helps

purna_dey’s picture

I'm using Ubuntu 11.10
PHP Version 5.3.6
Drupal 7.10

1) Just go to your Apache config file: sudo vim /etc/apache2/apache2.conf
2) After open it mention below like that:

<Directory /var/www/drupal7>
AllowOverride All
</Directory>

3) Make sure the "AccessFileName .htaccess" is Enable or not.
4) If not just enable it. [i.e #AccessFileName.htaccess, just remove "#" and save it.]
5) Restart apache: sudo /etc/init.d/apache2 restart
6) Now again go to Configuration -> Search and Meta data -> Clean URLs -> Check Clean URL test
7) This will allow clean URLs.

Another Way to enable the clean URL

  1. first enable the module as follows:
    sudo a2enmod rewrite
  2. Change all occurrence of "AllowOverRide None" to "AllowOverRide All". Basically all "None" to "All" in the following file:
    sudo vi /etc/apache2/sites-available/default
  3. Then Finally Restart Apache:
    /etc/init.d/apache2 restart

Thanks,

guenoz’s picture

That was my problem, change
AllowOverRide None
to
AllowOverRide All

Then run
sudo /etc/init.d/apache2 restart

Bingo !

HypervisedEd’s picture

You are also guilty of erroneously commenting backwards information in the wrong places.

HypervisedEd’s picture

Please take a minute to read what this post was about, its about disabling clean urls which is something people would want to do in the event that they need to migrate a site.

You have done nothing but pollute this post with garbage about how to enable clean urls which there are PLENTY of posts on.

Please do the community a favor and remove your reply, and in the future please devote some time to improve your reading comprehension skills before you let yourself lose control over responding unnecessary and erroneous information in the wrong places.

Sorry to come off as such a hard-you-know-what but I am currently trying to migrate my site to a new host and this is the first hit that shows up from a Google Query on how to disable clean-urls and you have destroyed it with your careless behavior.

bildelen’s picture

thanks. you saved me.

p.gian’s picture

This procedure worked fine for me, apart form the Clean Urls path. For my Drupal 7.15 installation, the working path is example.com/?q=admin/config/search/clean-urls.
Anyway, you helped me a lot!
Cheers!

brionM’s picture

There is still no answer to the original question so here is my try at it.

Clean Urls are set in the variables table in the item with a name of clean_url. The value is in a blob called value. It should be set to "i:1;". To unset, the value should be "i:0;".

You have to clear caches for the change to take effect.

I don't know how you would edit a blob in general. You can do it in SQL Workbench by right clicking on the blob and selecting "Open value in editor" and then selecting Apply in the edit window and again back in the original window. There may be better ways to do this.

FrogMeister’s picture

I know this is an old post but I just had the same issue so I thought I'd explain how I resolved it. I was not able to go to [example.com]/?q=admin/config/search/clean-urls and correct the problem. So, I decided to go the database route. brionM stated that:

the variables table in the item with a name of clean_url. The value is in a blob called value. It should be set to "i:1;". To unset, the value should be "i:0;".

You have to clear caches for the change to take effect.

I don't know how you would edit a blob in general. You can do it in SQL Workbench by right clicking on the blob and selecting "Open value in editor" and then selecting Apply in the edit window and again back in the original window. There may be better ways to do this.

I only had database access via phpMyAdmin so I took a chance and tried this:
1) Click on the table that contains "variables" in its name (left hand side)
2) Click on "Structure" (top of window)
3) In the row that contains: name "value", type "longblob", click "Change"
4) In drop-down list change "longblob" to "text"
5) Click "Save" button
6) Click on variables table (left)
7) Next to the variable name "clean_url", click "Edit"
8) Change the text value i:1; from to i:0;
9) Click "Go" button
10) Go back to Structure and change the value back to longblob and save

I advise you backup your database first just in case, but this worked beautifully for me.

jazzitup’s picture

There's a clean, Drupal way for this mess: https://www.drupal.org/node/5590