开发者

Lighttpd rewrite conversion?

开发者 https://www.devze.com 2023-03-02 05:37 出处:网络
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?

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

0

精彩评论

暂无评论...
验证码 换一张
取 消