IT.COM

Converting .htaccess to lighttpd.conf

Spaceship Spaceship
Watch
Impact
3
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!
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
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.
 
0
•••
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!
 
0
•••
HI in your original you have QSA to append a query string.

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

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"
)
 
0
•••
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]
 
0
•••
Peter i followed the process given by you and i am succeeded to convert htaccess to lighttpd.Thanks
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back