views:

29

answers:

2

I've done everything right. My server has mod_rewrite enabled, my virtualhost path has AllowOverride set to All, and I have the .htaccess file in place with the rewrite rules same as everyone. But I have trouble accessing some pages using their clean url paths. So for 90% of the pages, clean urls work fine. But for that 10%, they don't.

I have checked whether those pages exist -- they do. Checked whether they are accessible using index.php?q=[path] -- and they are. They are only inaccessible through clean url paths.

Can anyone help me with this mystery?

A: 

mod_rewrite has a few long-standing bugs that mangle URLs on the way through (do your problem urls have any escape characters?). I don't know if Drupal does this, but in other PHP apps I have had to add code to re-do the rewrite once the correct entrypoint has been reached.

Unfortunately, Drupal can't take its search path in PATH_INFO (as a lot of other apps do), otherwise you could use mod_alias which is much simpler and much more reliable.

George Steel
I don't think so. Here is one of the paths, for instance: node/add/product. It's as plain as they come.
picardo
I meant that your url is rewritten (by `mod_rewrite`) to `index.php?q=node/add/product` with the path in the query string instead of `index.php/node/add/product` with the path as a path.
George Steel
+1  A: 

Because you can access your pages through q=path/to/menu/item, then it's clear that it is mod_rewrite that is at fault and not Drupal.

To debug what is going on with your rewrite, either turn on the rewrite log and tail -f it while you request the troubled pages, or alternatively print_r($_GET) at the top of index.php or page.tpl.php to see what is actually being requested.

If you are comfortable posting your potentially sensitive .htaccess here, do so and we can have a look at it for you to see if there are any misconfigurations.

cam8001
Ok, I did the print_r($_GET). This is what I see: Array ( [q] => error/HTTP_NOT_FOUND.html.var )Warning: Cannot modify header information - headers already sent by (output started at X:\Dropboxen\Home\My Dropbox\Sites\drupal\index.php:4) in X:\Dropboxen\Home\My Dropbox\Sites\drupal\includes\bootstrap.inc on line 1369
picardo