View Single Post
Old 25th April 2005, 13:46
andre andre is offline
Junior Member
Join Date: Apr 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Drupal and Apache Rewrite Rules


I've set up a Drupal-based web site. Drupal is right in the web server's document root. Now Drupal can generate search-engine friendly URLs ( instead of, but to use this feature I have to create a .htaccess file with Apache rewrite rules in the document root.
Drupal comes with a sample .htaccess file, but it's not working. The rewrite rules look like this:

# Various rewrite rules
<IfModule mod_rewrite.c>
 RewriteEngine on

  # 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]

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

Reply With Quote
Sponsored Links