NamePros.com  

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Views: 6131
Reply
 
Thread Tools
Old 07-29-2010, 09:29 PM THREAD STARTER               #1 (permalink)
NamePros Regular
snike's Avatar
Join Date: Mar 2006
Location: USA
Posts: 496
snike has a spectacular aura aboutsnike has a spectacular aura about
 




Converting .htaccess to lighttpd.conf


I need some help converting this .htaccess file to lighttpd.conf. Can anyone help me out?

Code:
RewriteEngine On
RewriteRule ^film/(.*).html$ /index.php?typ=films&ef=$1 [QSA]
RewriteRule ^video/(.*).html$ /index.php?typ=videos&ef=$1 [QSA]
Thanks in advance!
snike is offline   Reply With Quote
Old 07-30-2010, 11:43 AM   #2 (permalink)
NamePros Expert
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,068
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 
Send a message via MSN to Peter Send a message via Skype™ to Peter




looking at the documentation located at Lighttpd - Docs:ModRewrite - lighty labs the following should be what you need:

Code:
url.rewrite-once = ( "^film/(.*).html$" => "/index.php?typ=films&ef=$1" )
url.rewrite-once = ( "^video/(.*).html$" => "/index.php?typ=videos&ef=$1" )
It simply uses regular expressions as mod rewrite does.


Manage your portfolio using my new Domain Portfolio Management script.
Securing Your Domain Name From Theft
Peter is offline   Reply With Quote
Old 11-13-2010, 05:16 PM THREAD STARTER               #3 (permalink)
NamePros Regular
snike's Avatar
Join Date: Mar 2006
Location: USA
Posts: 496
snike has a spectacular aura aboutsnike has a spectacular aura about
 




I tried the above code and although it makes complete sense, it isn't working for me. I have lighttpd installed, and I have checked that the module mod_rewrite is enable. It is. However, I am still not able to get this code working correctly. I remember having it work at one point but I don't remember what I did. Any suggestions on how to diagnose what the issue is? Any help is appreciated. Thank you!
snike is offline   Reply With Quote
Old 11-14-2010, 03:27 AM   #4 (permalink)
NamePros Regular
carob's Avatar
Join Date: Mar 2009
Posts: 915
carob has much to be proud ofcarob has much to be proud ofcarob has much to be proud ofcarob has much to be proud ofcarob has much to be proud ofcarob has much to be proud ofcarob has much to be proud ofcarob has much to be proud ofcarob has much to be proud of
 




HI in your original you have QSA to append a query string.

In the documentation linked above at the end you find this:

Quote:
Passing / Matching the Query string (GET variables)ΒΆ

If you wanna pass the Query String (?foo=bar) to the rewrite destination you have to explicitly match it:

url.rewrite-once = (
"^/news/([^\?]+)(\?(.*))?" => "/news.php?title=$1&$3"
)
carob is offline   Reply With Quote
Old 12-13-2010, 10:49 AM   #5 (permalink)
Account Suspended
bornowen's Avatar
Join Date: Dec 2010
Posts: 1
bornowen is an unknown quantity at this point
 




would recommend that you take a look at this thread which provides a basic guide to convert mod rewrite rule apache to lighttpd is

RewriteRule ^dmca-policy.html$ dmca-policy.html [L]
RewriteRule ^sitemap.xml$ sitemap.xml [L]
bornowen is offline   Reply With Quote
Old 12-20-2010, 09:10 PM   #6 (permalink)
NamePros Member
pausch's Avatar
Join Date: Nov 2010
Posts: 36
pausch is an unknown quantity at this point
 




Peter i followed the process given by you and i am succeeded to convert htaccess to lighttpd.Thanks


www.cheapwebhostinggeeks.com Let us help you find your Ideal Web Host.
pausch is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools




All times are GMT -7. The time now is 08:29 PM.



Domain name forum recommended by Domaining.com
Powered by: vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO
Don't use this form or this link. If you do, you'll automatically be blocked. nofollow