My old host crashed and burned - no telling when they'll be back - - ah well

Installed a fairly recent backup on Dreamhost (with cgi)
Having trouble with mod rewrite.- Tried all sorts of combinations of the mod rewrite code to no avail
Cannot access anything through drupal but the front page because of the CGI

Figure I could remove this landmine by turning off Clean URLS directly in the database or wherever it is kept.

Does anyone know what Table/Field is being updated when you turn on Clean URL's

Won't do it again..... promise!

Comments, Queries, Suggestions

T

Comments

styro’s picture

the variable table:

mysql> select * from drupal.variable where name = 'clean_url';
+-----------+----------+
| name      | value    |
+-----------+----------+
| clean_url | s:1:"1"; |
+-----------+----------+
1 row in set (0.00 sec)

I assume the new value to stick in there would be: s:1:"0";

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ

xfrankie’s picture

You must do "truncate cache" also

mikey_p’s picture

drupal short URLs work out from a standard install for me on dreamhost, no modifications to .htaccess were required.

Have you done something to your site such that accessing http://yoursite/?q=admin/settings doesn't work?

ThereseWeel’s picture

Thanks very much for your help

Anton Thanks for looking up that field for me I was blind with out it.
After checking out mikey's suggestion I found this thread http://drupal.org/node/60139

After trying a number of things I changed AND UNCOMMENTED $base_url in setting.php

Since I have drupal in a subdirectory my mod rewrite file looks like this

-----note how I included the subdirectory in the URL on the last line.




  # Modify the RewriteBase if you are using Drupal in a subdirectory and
  # the rewrite rules are not working properly.
# RewriteBase /drupal

  # Rewrite old-style URLs of the form 'node.php?id=x'.
  #RewriteCond %{REQUEST_FILENAME} !-f
  #RewriteCond %{REQUEST_FILENAME} !-d
  #RewriteCond %{QUERY_STRING} ^id=([^&]+)$
  #RewriteRule node.php index.php?q=node/view/%1 [L]

  # Rewrite old-style URLs of the form 'module.php?mod=x'.
  #RewriteCond %{REQUEST_FILENAME} !-f
  #RewriteCond %{REQUEST_FILENAME} !-d
  #RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
  #RewriteRule module.php index.php?q=%1 [L]

#Dreamhost recommends
RewriteCond %{REQUEST_URI} ^/stats/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/failed_auth.html$
RewriteRule ^.*$ - [L]

# Rewrite current-style URLs of the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /VTDW/index.php?q=$1 [L,QSA]

</IfModule>

One down....

Therese
http://datadesigns.ca
vancouver bc

styro’s picture

I notice you've added your subdirectory into the RewriteRule. Did you first try editing the RewriteBase directory at the start of the mod_rewrite stuff? It is commented out by default.

That is the setting that is intended to alter the rules for subdirectories, and is a cleaner more obvious way of setting it. ie less likely to be overlooked and forgotten about a year down the track when it comes time to upgrade your site :)

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ

ThereseWeel’s picture

I removed the reference to the subdirectory in the last line
My base url in settings.php is uncommented and set to

$base_url = 'http://www.virtualtoolshed.ca/VTDW'; // NO trailing slash!

I tried the following values of rewrite base to no avail

RewriteBase /VTDW
RewriteBase /cgi-base
RewriteBase /cgi-system

the front page works fine but any sub pages get this error

----The requested URL /index.php was not found on this server.

The .htaccess file is below

hmmph! think I'll leave myself a comment
unless you can spot something else



  # Modify the RewriteBase if you are using Drupal in a subdirectory and
  # the rewrite rules are not working properly.
RewriteBase /VTDW

  # Rewrite old-style URLs of the form 'node.php?id=x'.
  #RewriteCond %{REQUEST_FILENAME} !-f
  #RewriteCond %{REQUEST_FILENAME} !-d
  #RewriteCond %{QUERY_STRING} ^id=([^&]+)$
  #RewriteRule node.php index.php?q=node/view/%1 [L]

  # Rewrite old-style URLs of the form 'module.php?mod=x'.
  #RewriteCond %{REQUEST_FILENAME} !-f
  #RewriteCond %{REQUEST_FILENAME} !-d
  #RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
  #RewriteRule module.php index.php?q=%1 [L]

#Dreamhost recommends
RewriteCond %{REQUEST_URI} ^/stats/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/failed_auth.html$
RewriteRule ^.*$ - [L]

# Rewrite current-style URLs of the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]

</IfModule>

Therese
http://datadesigns.ca
vancouver bc

styro’s picture

You should (I think) remove the slash before index.php in your last RewriteRule - the standard .htaccess doesn't include a slash. eg:

  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Leaving it there means that it looks for index.php in your root directory.

PS: Another useful hint for later - if you want to show output that contains HTML tags or Apache config containers in a forum post you can wrap it in <code></code> tags and the tags will be properly escaped so the browser doesn't try to render them.

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ

LenisDaniel’s picture

My installation is functional now

mchelen’s picture

the direct path to turn it off is: /?q=admin/settings/clean-urls

All opinions are personal and do not represent anyone but myself.

pamphile’s picture

I spent 2 hours searching until I prayed and realized that my new installation of Apache had this line commented in Apache.conf

#LoadModule rewrite_module modules/mod_rewrite.so

I uncommented it and rewrite worked again

Marcel
PrewrittenContent.com
Drupal Themes
Writing Schedule

maksim24’s picture

I spent 2 days. Thanks for your tips
I think apache should say us about this

WaPoNe’s picture

I had the same problem..
It was linked to clean url's on my server.
I uncommented #LoadModule rewrite_module modules/mod_rewrite.so row and rewrite worked again.

Thanks,
WaPoNe

Stephen Winters’s picture

subscribe

rmanola’s picture

subscribe

rgchi’s picture

$ drush vset clean_url 0

Good drush reference:
http://groups.drupal.org/node/113534

DocDJ-forum’s picture

this drush command doesn't seem to work if you don't have a working Drupal.
I opened a command prompt (Windows), ran drushenv, then the drush clean_url 0 --yes
but it said it needed a higher level and a working Drupal install.
I guess I need to turn them off & clear the cache before exporting, the turn them back on when/if I get a working Drupal site after import.

---------- addendum -----------------
Another clue. I tried this:

mysql> select * from mysitetable.variable where name = 'clean_url';
+------------+--------+
| name      | value |
+------------+--------+
| clean_url |   i:1;  |
+------------+--------+

1 row in set (0.00 sec)

Compared to a working site, I see there is a difference in the value. A working site has THIS value:
s:1:"1";
Why would mine say something different. If I interpret this properly. MY site thinks it's an integer, the working site thinks it's a string.
That tells me there is a problem in my table, but I don't know enough about the table to try to fix it.
Any advice??

regards,
DJ

rgchi’s picture

When you see the message "higher level" typically drush wants to operate from within the root of your site install. That is (on *nix) inside /var/www/html or a child folder thereof. You can also use the drush -r /var/www/html parameter to specific a path. Essentially, it has to find settings.php in order to log into the database. Drush works wonderfully on a multisite installation as well.