需要帮助将 apache .htaccess 代码转换为 lighttpd url_rewrite 代码

发布于 2024-07-21 10:56:44 字数 565 浏览 5 评论 0原文

我有这个基于 XAMPP 构建的自定义编写的 CMS。 我正在尝试在lighttpd 上进行相同的测试,以对所谓的性能增益进行基准测试...但我坚持重写规则。 我在 .htaccess 中使用 WordPress 的默认重写规则,只要不存在任何与 URL 结构相同的文件或目录,就会将所有 url 解析交给我的脚本。 这是代码:

RewriteBase /somedir/

# Let the Script handle all pretty URLs
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule .* index.php [L]

任何人都可以帮我将其翻译为lighttpd 格式吗? 我只能(部分)自己通过简单的文档找出最后一行......即

url.rewrite-once = ( ".*" => "index.php" )

但这当然还不够......我的CMS所做的就是给我404。

谢谢, 微观^地球

I have this custom written CMS built on XAMPP. I'm trying to test the same on lighttpd to benchmark the so-called performance gains... but am stuck at the rewrite rules. I use the default rewrite rules of WordPress in my .htaccess which hands all url parsing over to my script as long as there aren't any files or directories same as the URL structure. Here's the code:

RewriteBase /somedir/

# Let the Script handle all pretty URLs
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule .* index.php [L]

Can anyone please help me translate the same to the lighttpd format? I could only (partially) figure out the last line myself going through the lighty docs ... i.e.

url.rewrite-once = ( ".*" => "index.php" )

But that of course won't suffice... All my CMS is doing is giving me 404's.

Thanks,
miCRoSCoPiC^eaRthLinG

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冬天旳寂寞 2024-07-28 10:56:44

您可以尝试将 php 脚本设置为 404 URL:

server.error-handler-404 = "/404.php"

然后在该脚本中设置变量(例如 $_GET),然后包含目标脚本。

You can try setting a php script as 404 URL:

server.error-handler-404 = "/404.php"

Then in this script set the variables (such as $_GET) and then include the target script.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文