Hi there. I'm setting up a new install of Drupal 7 and have run into a problem with Drupal trying to get request URLs from Apache. I want to keep the drupal files together in their own directory, but I don't want the URLs generated by Drupal to have '/drupal7' on the front.
public_html/.htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* /drupal7/$0 [last]
With this setup, going to http://example.com/taxonomy/3 correctly serves me a page as if I had gone to http://example.com/drupal7/taxonomy/3; so far so good. However, the links on that page all have /drupal7 on the beginning. In order to prevent that, I did the following:
public_html/drupal7/sites/default/settings.php:
$base_url = 'http://example.com';
Now the generated links look correct: http://example.com/taxonomy/3, but there is a problem when I actually follow one of them: I get a 404 error! When I look at the 'Recent log messages' report, I see a 'page not found' log entry for the following message: 'term/3'. It seems that the first 9 characters of the request path have been stripped.
I solved this by monkey-patching the request_path function like so: