需要帮助将 apache .htaccess 代码转换为 lighttpd url_rewrite 代码
我有这个基于 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试将 php 脚本设置为 404 URL:
然后在该脚本中设置变量(例如 $_GET),然后包含目标脚本。
You can try setting a php script as 404 URL:
Then in this script set the variables (such as $_GET) and then include the target script.