|
What do you get when you put a webserver on a diet? You get lighttpd: a speedy, fast, secure, and standards-compliant webserver. If you decide to put your web hosting budget on a diet, consider VPS Hosting from VPSLink. Our Link-1 plan includes 24/7/365 hardware and network support, full root access, and - most importantly - it gets along quite well with lighttpd. |
|
|||
|
Hi,
How to convert this .htaccess file to lighttpd rewrite rule ? Code:
DirectoryIndex index.php
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/uploads/fotos/*.*
RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^.*$ /notfound [L,N]
RewriteRule ^.*$ /notfound [QSA,L,R=301]
RewriteRule ^page/(.*)$ index.php?cstart=$1 [L]
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$ index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6 [L]
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$ index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5 [L]
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$ engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5 [L]
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$ index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4 [L]
RewriteRule ^([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$ index.php?newsid=$4&news_page=$2&cstart=$3 [L]
RewriteRule ^([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$ index.php?newsid=$3&news_page=$2 [L]
RewriteRule ^([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$ engine/print.php?news_page=$2&newsid=$3 [L]
RewriteRule ^([^.]+)/([0-9]+)-(.*).html(/?)+$ index.php?newsid=$2 [L]
RewriteRule ^page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$ index.php?newsid=$3&news_page=$1&cstart=$2 [L]
RewriteRule ^page,([0-9]+),([0-9]+)-(.*).html(/?)+$ index.php?newsid=$2&news_page=$1 [L]
RewriteRule ^print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$ engine/print.php?news_page=$1&newsid=$2 [L]
RewriteRule ^([0-9]+)-(.*).html(/?)+$ index.php?newsid=$1 [L]
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$ index.php?year=$1&month=$2&day=$3 [L]
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$ index.php?year=$1&month=$2&day=$3&cstart=$4 [L]
RewriteRule ^([0-9]{4})/([0-9]{2})(/?)+$ index.php?year=$1&month=$2 [L]
RewriteRule ^([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$ index.php?year=$1&month=$2&cstart=$3 [L]
RewriteRule ^([0-9]{4})(/?)+$ index.php?year=$1 [L]
RewriteRule ^([0-9]{4})/page/([0-9]+)(/?)+$ index.php?year=$1&cstart=$2 [L]
RewriteRule ^tags/([^/]*)(/?)+$ index.php?do=tags&tag=$1 [L]
RewriteRule ^tags/([^/]*)/page/([0-9]+)(/?)+$ index.php?do=tags&tag=$1&cstart=$2 [L]
RewriteRule ^user/([^/]*)/rss.xml$ engine/rss.php?subaction=allnews&user=$1 [L]
RewriteRule ^user/([^/]*)(/?)+$ index.php?subaction=userinfo&user=$1 [L]
RewriteRule ^user/([^/]*)/page/([0-9]+)(/?)+$ index.php?subaction=userinfo&user=$1&cstart=$2 [L]
RewriteRule ^user/([^/]*)/news(/?)+$ index.php?subaction=allnews&user=$1 [L]
RewriteRule ^user/([^/]*)/news/page/([0-9]+)(/?)+$ index.php?subaction=allnews&user=$1&cstart=$2 [L]
RewriteRule ^user/([^/]*)/news/rss.xml(/?)+$ engine/rss.php?subaction=allnews&user=$1 [L]
RewriteRule ^lastnews/(/?)+$ index.php?do=lastnews [L]
RewriteRule ^lastnews/page/([0-9]+)(/?)+$ index.php?do=lastnews&cstart=$1 [L]
RewriteRule ^catalog/([^/]*)(/?)+$ index.php?catalog=$1 [L]
RewriteRule ^catalog/([^/]*)/page/([0-9]+)(/?)+$ index.php?catalog=$1&cstart=$2 [L]
RewriteRule ^newposts(/?)+$ index.php?subaction=newposts [L]
RewriteRule ^newposts/page/([0-9]+)(/?)+$ index.php?subaction=newposts&cstart=$1 [L]
RewriteRule ^static/(.*).html(/?)+$ index.php?do=static&page=$1 [L]
RewriteRule ^favorites(/?)+$ index.php?do=favorites [L]
RewriteRule ^favorites/page/([0-9]+)(/?)+$ index.php?do=favorites&cstart=$1 [L]
RewriteRule ^rules.html$ index.php?do=rules [L]
RewriteRule ^dmca-policy.html$ dmca-policy.html [L]
RewriteRule ^statistics.html$ index.php?do=stats [L]
RewriteRule ^addnews.html$ index.php?do=addnews [L]
RewriteRule ^rss.xml$ engine/rss.php [L]
RewriteRule ^sitemap.xml$ sitemap.xml [L]
RewriteRule ^google9f559184ca0e96de.html$ google9f559184ca0e96de.html [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^.]+)/page/([0-9]+)(/?)+$ index.php?do=cat&category=$1&cstart=$2 [L]
RewriteCond %{REQUEST_URI} !^/notfound
RewriteRule ^([^.]+)/?$ index.php?do=cat&category=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^<]+)/rss.xml$ engine/rss.php?do=cat&category=$1 [L]
RewriteRule ^page,([0-9]+),([^/]+).html$ index.php?do=static&page=$2&news_page=$1 [L]
RewriteRule ^print:([^/]+).html$ engine/print.php?do=static&page=$1 [L]
RewriteRule ^([^/]+)\.html$ index.php?do=static&page=$1 [L]
|
|
|||
|
I would recommend that you take a look at this thread which provides a basic guide to convert mod rewrite rule apache to lighttpd - if I were in your position, however, I would seriously consider getting rid of some of these rules before trying to duplicate them in lighttpd.
Rules like these are not effectively doing anything: Code:
RewriteRule ^dmca-policy.html$ dmca-policy.html [L] RewriteRule ^sitemap.xml$ sitemap.xml [L] |
|
|||
|
Dear DanL@VPSLink,
Thanks for your respond. Yes, i read the above article too, but i don't understand anything. =( Can you plz see the below codes & inform me it's correct or not? Code:
"^page/(.*)$" => "/index.php?cstart=$1",
"^([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" => "/index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6",
"^([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" => "/index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5",
"^([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" => "/engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5",
"^([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" => "/index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4",
"^([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" => "/index.php?newsid=$4&news_page=$2&cstart=$3",
"^([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" => "/index.php?newsid=$3&news_page=$2",
"^([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" => "/engine/print.php?news_page=$2&newsid=$3",
"^([^.]+)/([0-9]+)-(.*).html(/?)+$" => "/index.php?newsid=$2",
"^page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" => "/index.php?newsid=$3&news_page=$1&cstart=$2",
"^page,([0-9]+),([0-9]+)-(.*).html(/?)+$" => "/index.php?newsid=$2&news_page=$1",
"^print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" => "/engine/print.php?news_page=$1&newsid=$2",
"^([0-9]+)-(.*).html(/?)+$" => "/index.php?newsid=$1",
"^([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$" => "/index.php?year=$1&month=$2&day=$3",
"^([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$" => "/index.php?year=$1&month=$2&day=$3&cstart=$4",
"^([0-9]{4})/([0-9]{2})(/?)+$" => "/index.php?year=$1&month=$2",
"^([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$" => "/index.php?year=$1&month=$2&cstart=$3",
"^([0-9]{4})(/?)+$" => "/index.php?year=$1",
"^([0-9]{4})/page/([0-9]+)(/?)+$" => "/index.php?year=$1&cstart=$2",
"^tags/([^/]*)(/?)+$" => "/index.php?do=tags&tag=$1",
"^tags/([^/]*)/page/([0-9]+)(/?)+$" => "/index.php?do=tags&tag=$1&cstart=$2",
"^user/([^/]*)/rss.xml$" => "/engine/rss.php?subaction=allnews&user=$1",
"^user/([^/]*)(/?)+$" => "/index.php?subaction=userinfo&user=$1",
"^user/([^/]*)/page/([0-9]+)(/?)+$" => "/index.php?subaction=userinfo&user=$1&cstart=$2",
"^user/([^/]*)/news(/?)+$" => "/index.php?subaction=allnews&user=$1",
"^user/([^/]*)/news/page/([0-9]+)(/?)+$" => "/index.php?subaction=allnews&user=$1&cstart=$2",
"^user/([^/]*)/news/rss.xml(/?)+$" => "/engine/rss.php?subaction=allnews&user=$1",
"^lastnews/(/?)+$" => "/index.php?do=lastnews",
"^lastnews/page/([0-9]+)(/?)+$" => "/index.php?do=lastnews&cstart=$1",
"^catalog/([^/]*)(/?)+$" => "/index.php?catalog=$1",
"^catalog/([^/]*)/page/([0-9]+)(/?)+$" => "/index.php?catalog=$1&cstart=$2",
"^newposts(/?)+$" => "/index.php?subaction=newposts",
"^newposts/page/([0-9]+)(/?)+$" => "/index.php?subaction=newposts&cstart=$1",
"^static/(.*).html(/?)+$" => "/index.php?do=static&page=$1",
"^favorites(/?)+$" => "/index.php?do=favorites",
"^favorites/page/([0-9]+)(/?)+$" => "/index.php?do=favorites&cstart=$1",
"^rules.html$" => "/index.php?do=rules",
"^dmca-policy.html$" => "/dmca-policy.html",
"^statistics.html$" => "/index.php?do=stats",
"^addnews.html$" => "/index.php?do=addnews",
"^rss.xml$" => "/engine/rss.php",
"^sitemap.xml$" => "/sitemap.xml",
"^google9f559184ca0e96de.html$" => "/google9f559184ca0e96de.html",
"%{REQUEST_FILENAME}" => "/!-d",
"^([^.]+)/page/([0-9]+)(/?)+$" => "/index.php?do=cat&category=$1&cstart=$2",
"%{REQUEST_URI}" => "/!^/notfound",
"^([^.]+)/?$" => "/index.php?do=cat&category=$1",
"%{REQUEST_FILENAME}" => "/!-f",
"^([^<]+)/rss.xml$" => "/engine/rss.php?do=cat&category=$1",
"^page,([0-9]+),([^/]+).html$" => "/index.php?do=static&page=$2&news_page=$1",
"^print[^/]+).html$" => "/engine/print.php?do=static&page=$1",
"^([^/]+)\.html$" => "/index.php?do=static&page=$1",
|
|
|||
|
VPSLink's service is unmanaged - we do not provide application-level support and as much as I or our technicians would like to help, the task which you've presented would probably take a great deal of time to complete correctly and none of our staff are being paid to provide this type of support.
My best recommendation would be that you review the lighttpd mod_rewrite documentation and visit the lighttpd Support Forums if you have questions specific to lighttpd which are not being answered to your satisfaction here on the VPSLink forums. |
|
|||
|
The best way to determine this is to commit the changes and test for yourself. Use the docs DanL linked to if you run into any issues.
__________________
| Technology Made Simple | Outlook Email Encryption | Blackberry Email Encryption | Dell Beep Codes | |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|