Project

General

Profile

JoomlaSEO » History » Revision 7

Revision 6 (Anonymous, 2008-09-17 15:32) → Revision 7/8 (Anonymous, 2012-08-11 10:42)

1 - Install Joomla 

 2 - Go Joomla admin -> Global Configuration -> Site. Enable    *Search Engine Friendly URLs* and    *Use Apache mod_rewrite* 

 3 - In lhttpd add this site description, where change ''' 

 <pre> 

 $HTTP["host"] 
 </pre> 

 and  

 <pre> 

 server.document-root 
 </pre> 

 to you's settings 



 Example 

  

 <pre> 

 $HTTP["host"] =~ "(^|\.)site\.com$" { 
 server.document-root = "/usr/local/www/data/site.com" 
    url.rewrite-once = ( 
           "^images*\\.(jpg|jpeg|gif|png)" => "$0", 
           "^/administrator.*$" => "$0", 
           "^/mambots.*$" => "$0", 
           "(/|\\.htm|\\.php|\\.html|/[^.]*)$" => "/index.php" 
      ) 
 } 
 </pre> 






 Instead of this you can do the rewrites it using lua. Create a new file and add: 


 <pre> 

 -- little helper function 
 function file_exists(path) 
   local attr = lighty.stat(path) 
   if (attr) then 
       return true 
   else 
       return false 
   end 
 end 
 function removePrefix(str, prefix) 
   return str:sub(1,#prefix+1) == prefix.."/" and str:sub(#prefix+2) 
 end 

 -- prefix without the trailing slash 
 local prefix = '' 

 -- the magic ;) 
 if (not file_exists(lighty.env["physical.path"])) then 
     -- file still missing. pass it to the fastcgi backend 
     request_uri = removePrefix(lighty.env["uri.path"], prefix) 
     if request_uri then 
       lighty.env["uri.path"]            = prefix .. "/index.php" 
       local uriquery = lighty.env["uri.query"] or "" 
       lighty.env["uri.query"] = uriquery .. (uriquery ~= "" and "&" or "") .. "q=" .. request_uri 
       lighty.env["physical.rel-path"] = lighty.env["uri.path"] 
       lighty.env["request.orig-uri"]    = lighty.env["request.uri"] 
       lighty.env["physical.path"]       = lighty.env["physical.doc-root"] .. lighty.env["physical.rel-path"] 
     end 
 end 
 -- fallthrough will put it back into the lighty request loop 
 -- that means we get the 304 handling for free. ;) 
 </pre> 


 Then on your lighttpd.conf add something like this: 


 <pre> 

 $HTTP["url"] !~ "^/(xcache-admin|awstatsclasses|awstatsicons|awstatscss|awstats|cacti|webmail|phpmyadmin)(/|$)" { 
 index-file.names = ( "index.php" ) 
 magnet.attract-physical-path-to = ( "/usr/local/etc/lighttpd/lua/domain.com/www.lua" ) 
 } 
 </pre>