gpt4 book ai didi

linux - URL 重写给出 500 Internal server error

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:32:18 24 4
gpt4 key购买 nike

我的第二个 URL 重定向失败,当我点击 URL 时服务器给出 500 内部服务器错误:example.com/services/SV0087,但第一个重定向有效:example.com/items/I5402.

<IfModule mod_rewrite.c>
Options +FollowSymlinks -Indexes
RewriteEngine on

RewriteOptions inherit

AddType text/x-component .htc

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$

####### this works seamlessly
RewriteRule ^items/([^/]*)$ /items/index.asp?itemcode=$1 [L]

- 这给出了 500 个内部服务器错误

RewriteRule ^services/([^/]*)$ /services/index.asp?servicecode=$1 [L]

- 当我执行 $_GET['servicecode']

时,它会收到作为 index.asp 的值
RewriteRule ^services/([^/]*)$ services/index.asp?servicecode=$1 [L]

最佳答案

我必须分别为两个 URL 编写完整的条件代码,然后它起作用了:

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$

RewriteRule ^items/([^/]*)$ /items/index.asp?itemcode=$1 [L]




RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$

RewriteRule ^services/([^/]*)$ /services/index.asp?servicecode=$1 [L]

关于linux - URL 重写给出 500 Internal server error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56140846/

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