Ok, so I'm trying to get Clean URLs working with Drupal 6.6 on my (unix/apache) hosted site.

Conditions:
* I'm using the .htaccess from drupal-6.6.tar.gz

The /admin/settings/clean_url page says "Your server has been successfully tested to support this feature."

* Before I enable Clean URLS the browser address bar says "http://www.mysite.com/?q=admin/settings/clean-urls"

* After I enable Clean URLS the browser address bar says "http://www.salmonbayschool.org/admin/settings/clean-urls," which is great but the page displays incorrectly, showing only unformatted navigation block links and the text "Access denied You are not authorized to access this page."

* Based on searches of the forum this is a fairly common error.

The various solutions I've tried so far from various forum posts (e.g. uncomment RewriteBase /, remove everything but the specific RewriteCond...RewriteRule lines) and so far nothing doing.

Here's where it gets interesting though. Obviously the .htaccess rewrite conditions are still in effect whether or not Clean URLs are enabled so I started experimenting by hand-entering "correct" URLs into the browser address bar.

Test #1: If I simply enter http://www.mysite.com/ I everything works fine. That's to be expected.
Test #2: If I enter http://www.mysite.com/node (no trailing slash) everything looks great.
Test #3: If I enter http://www.mysite.com/node/ (trailing slash) the HTML elements are found and displayed but there's no CSS formatting. (More about that in a minute)
Test #4: If I enter http://www.mysite.com/node/3 or http://www.mysite.com/node/3/ (i.e. with or without a trailing slash) the HTML arrives but again there's no CSS formatting.
Test #5: If I enter http://www.mysite.com/?q=node/3 (i.e. the regular "non-clean" way of addressing Drupal pages) everything works correctly. No surprise here, the site's been working fine with non-clean URLs for more than a year.

So. Moving ahead I next tried If I view the source for pages that do and don't work I find the following

Again, without enabling Clean URLs іn the Drupal interface, when I examined page sources for "clean" vs "regular" URLs I get the following anomaly.

If I use www.mysite.com/?q=/node/3 I get (correct) header entries like
<link type="text/css" rel="stylesheet" media="all" href="/modules/node/node.css?E" />
The path in the href argument contains the correct path to the CSS files.

If I use the URL www.mysite.com/node/3 I get (incorrect) header entries like
<link type="text/css" rel="stylesheet" media="all" href="/node/modules/node/node.css?E" />
The path in the href argument points has an extra "/node" prepended to the path, rendering it incorrect.

I'm not the worlds most technical guy but as a former Perl junkie and Vi/Vim user I'm pretty familiar with regular expressions and I'm able to navigate a man page. Looking at the relevant lines in .htaccess I just don't see how the line "RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]" is supposed to parse the base URL (www.mysite.com) from the "argument" part (/node, /node/3, or whatever.) Consequently it sort of makes sense that the extra "/node" would be added in to the relative paths on my site.

More to the point, again from my very limited understanding, it looks to me like the "DirectoryIndex index.php" entry in .htaccess would append "index.php" to the end of any fully qualified path (resulting in, e.g. http://www.mysite.com/node/3/index.htm) with the result that the later rewrite rules give me the extraneous "/node" in my broken paths.

Mine is not to question how Apache or its Rewrite feature works, especially since I haven't thoroughly read the Apache Rewrite documentation. But it does look like my .htaccess is configured just like everyone elses.

What *doesn't* make sense to me, then, is *since* it works for everyone else why doesn't it work for me?

Finally, for what it's worth if I enable Clean URLs I get the same general effect, with an added bonus
- Everything displays correctly for, say, http://www.mysite.com/node
- The paths to CSS files are corrupted for, say, http://www.mysite.com/node/3
Plus, paths that are dynamically written by Drupal also have the extra "/node" (or "/blog" or whatever) inserted at the beginning of the rewritten-argument part.

So what completely obvious element -- a Drupal configuration option maybe? -- am I missing?

Thanks!

David Innes