I'm not sure if this belongs here or in serverfault, so feel free to flag it if necessary. I have a server with a drupal installation at /drupal. I want the URL www.example.com to point to www.example.com/drupal. I don't want to change my server root, just do an Apache Rewrite.

RewriteRule (.*) /drupal/$1

This works, so when I type www.example.com I go to the drupal site. The issue is no other URLs go to the correct spot. So when I type a URL like www.example.com/about, I see the drupal theme but then the content just says

The requested page "/about" could not be found.

The page www.example.com/drupal/about does show up fine. I've also changed $base_url to www.example.com. Any idea what could be wrong?

I've also tested that URLs like www.example.com/?q=node/16 work fine, so the problem is just with clean URLs.

1 Answer 1


Problem in drupal Clean URL, To Enable drupal clean url in subdirectory un comment the following line in .htaccess file.

  # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
  # VirtualDocumentRoot and the rewrite rules are not working properly.
  # For example if your site is at http://example.com/drupal uncomment and
  # modify the following line:
  # RewriteBase /drupal
  # If your site is running in a VirtualDocumentRoot at http://example.com/,
  # uncomment the following line:
  RewriteBase /

for more refer the blog Enable drupal clean url in subdirectory or subdomain

  • I've uncommented that line and restarted the apache server but the issue is still there. But you're right that the problem is with clean urls, I've tested that URLs like /?q=node/16 work fine.
    – gsgx
    Jul 9, 2012 at 12:27
  • Solution to use virtual hosts drupal.org/node/111238
    – Balaji D
    Jul 9, 2012 at 12:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.