gpt4 book ai didi

apache - .htaccess 在本地工作,但不在 1and1 服务器上

转载 作者:行者123 更新时间:2023-12-04 16:53:24 25 4
gpt4 key购买 nike

我将当前的 .htaccess 文件上传到 1and1 服务器(实际上是 1und1.de,但我猜它是一样的)并且我收到了 500 内部服务器错误。

Options -MultiViews 
RewriteEngine On
RewriteBase /lammkontor

RewriteRule ^categories/([^/\.]+)/?$ index.php?url=category.php&cat_url=$1 [L]
RewriteRule ^categories/([^/\.]+)/([^/\.]+)/?$ index.php?url=product.php&cat_url=$1&prod_url=$2 [L]
RewriteRule ^categories/([^/\.]+)/([^/\.]+)/recipes?$ index.php?url=recipes.php&cat_url=$1&prod_url=$2 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+\.php)/?$ index.php?url=$1 [QSA]

这个 .htaccess 在我的本地 MAMP 服务器上完美运行。

当我使用示例文件在控制中心测试 CGI-Monitor 时,我得到 - cgi: File not present or has invalid modes
(no output)

现在唯一工作的文件是 index.php

谢谢你的帮助!

最佳答案

实际上,我解决了在每个重写规则开头添加斜杠的问题,例如:

RewriteRule ^(.+\.php)/?$ /index.php?url=$1 [QSA]

代替
RewriteRule ^(.+\.php)/?$ index.php?url=$1 [QSA]

谢谢!

关于apache - .htaccess 在本地工作,但不在 1and1 服务器上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17499313/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com