How to Enable clean urls in drupal 6.xx and lighttpd

To enable clean url in drupal when we use lighttpd as webserver it needs a small hack…

we need to edit the configuration file ( /etc/lighttpd/lighttpd.conf) .In the server modules “mod_rewrite” must beenabled else edit it to the same.After editing server modules look like this

server.modules              = (
            "mod_access",
            "mod_alias",
            "mod_accesslog",
            "mod_compress",
            "mod_rewrite",
#           "mod_redirect",
#           "mod_evhost",
#           "mod_usertrack",
#           "mod_rrdtool",
#           "mod_webdav",
#           "mod_expire",
#           "mod_flv_streaming",
#           "mod_evasive"
            "mod_secdownload",
            "mod_flv_streaming",
)

Then add this bunch of code to the lighttpd.conf file

url.rewrite-final = (
  "^/system/test/(.*)$" => "/index.php?q=system/test/$1",
  "^/system/test-clean-url/(.*)$" => "/index.php?q=system/test-clean-url/$1",
  "^/drupal/([^.?]*)\?(.*)$" => "/drupal/index.php?q=$1&$2",
  "^/drupal/([^.?]*)$" => "/drupal/index.php?q=$1",
  "^/drupal/search/(.*)$" => "/drupal/index.php?q=search/$1",
   "/drupal/rss.xml$" => "/drupal/index.php?q=rss.xml"
)
#url.rewrite-if-not-file = (
#    "^\/([^\?]*)\?(.*)$" => "/newone/index.php?q=$1&$2",
#    "^\/(.*)$" => "/newone/index.php?q=$1"
#)

Rename the drupal with the name of your folder in the code

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s