Lighttpd rewrite conversion?
So, I'm trying to move a site over to Lighttpd but I can't seem to get the URL re-writes correct - any idea what these would translate to in Lighttpd-speak?
RewriteRule ^portfolio/([^/]+) /index.php?portfolio=$1 [NC]
RewriteCond $1 ^(portfolio|news|about|contact|h开发者_运维问答ome|P[0-9]{2,8}) [NC]
RewriteRule ^(.*)$ /index.php/$1 [L]
I've tried a few configurations to no avail:
"^/(?!portfolio)(.+)/?$" => "/index.php?portfolio=$1"
"^/portfolio/(\d+)(?:\?(.*))?" => "/index.php?portfolio=$1"
I think this will work for you:
"^(/portfolio/.*)$" => "/index.php?portfolio=$1"
That will rewrite all urls like example.com/portfolio/123 to index.php?portfolio=123
Use just ^(.*)$ to rewrite everything to one url
精彩评论