View Single Post
  #1  
Old 25th April 2005, 12: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

Hi,

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 (www.domain.com/a/b/c instead of www.domain.com/index.php?1=a&2=b&3=c), 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:

Code:
# 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]
</IfModule>
What's wrong here?

Andre
Reply With Quote
Sponsored Links