emcgfx Posted April 14, 2009 Share Posted April 14, 2009 How can I rewrite this rule for LightTPD, please help. RewriteRule ^([^\.]+)$ index.php?p=$1 [L] I have tried this >> url.rewrite-final = ( "^/([^.?]*)$" => "/index.php?p=$1" ) without any success. Thank You. Quote Link to comment https://forums.phpfreaks.com/topic/154008-apache-to-lighttpd-simple-rewrite/ Share on other sites More sharing options...
alexweber15 Posted April 18, 2009 Share Posted April 18, 2009 gonna hop on this thread if you don't mind cause i have a very similar question I was wondering if Lighttpd had a similar mod_rewrite, i guess it does Quote Link to comment https://forums.phpfreaks.com/topic/154008-apache-to-lighttpd-simple-rewrite/#findComment-813065 Share on other sites More sharing options...
pornophobic Posted May 17, 2010 Share Posted May 17, 2010 LightTPD does have a rewrite module. By default it is not enabled if you build from source or even install it using an rpm. To enable it you'll need to edit your config file. ... server.modules = ( # "mod_rewrite", # "mod_redirect", ... and uncomment the mod_rewrite: ... server.modules = ( "mod_rewrite", # "mod_redirect", ... Then restart your lighttpd server. Usually: /etc/init.d/lighttpd reload but if you don't have an init script: lighttpd -f /path/to/config/file.conf After that, you'll need to add in a rewrite to one of your configuration files. If you are hosting only one site you can do it right in the lighttpd.conf file as: url.rewrite = ( "^/([^.?]*)$" => "/index.php?p=$1" ) If you need to do it for multiple sites you can find out more in the documentation. Quote Link to comment https://forums.phpfreaks.com/topic/154008-apache-to-lighttpd-simple-rewrite/#findComment-1059793 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.