当前位置: 首页 > 知识库问答 >
问题:

删除. php从URL使用Plesk指令

柳镜
2023-03-14

我用的是plesk-onyx和nginx,不管怎样都可以去除这个缺陷。使用指令从我的链接中删除php?这是我到目前为止所拥有的,但我仍然拥有。url末尾的php

    #ignored: condition 0
if ($http_host ~* "^www\."){
    set $rule_0 1;
    break;
}
if ($rule_0 = "1"){
    rewrite ^/ https://example.com$uri permanent;
}
rewrite ^/directory/([A-Za-z-]+)/?$ https://example.com/directory/$1.php last;
rewrite ^/rss/medicinecategory.php$ https://example.com/directory/medical-specialties permanent;
rewrite ^/rss/medicalconditions.php$ https://example.com/directory/medical-conditions permanent;
rewrite ^/rss/cancers.php$ https://example.com/directory/cancers permanent;
rewrite ^/rss/infectiousdiseases.php$ https://example.com/directory/infectious-diseases permanent;
rewrite ^/rss/surgical_procedures.php$ https://example.com/directory/medical-procedures permanent;
rewrite ^/rss/therapies.php$ https://example.com/directory/therapies permanent;
rewrite ^/rss/vaccines.php$ https://example.com/directory/vaccines permanent;
rewrite ^/rss/drugs.php$ https://example.com/directory/drugs permanent;
rewrite ^/rss/health_management.php$ https://example.com/directory/health-management permanent;
rewrite ^/rss/medical_education.php$ https://example.com/directory/medical-training permanent;
if ($args ~ "podcasts|blogs|news"){
    set $rule_12 1$rule_12;
}
if ($rule_12 = "1"){
    rewrite ^/rss/index.php/Consumer-Health-Advice/91/$ https://example.com/rss/index.php/Consumer-Health-News/26/ permanent;
}
rewrite ^/rss/index.php/Consumer-Health-Advice/91/$ https://example.com/rss/index.php/Consumer-Health-News/26/$1? permanent;

共有1个答案

朱啸
2023-03-14

讨论了如何消除这两种情况的类似问题。php和。使用NGINX?从url进行html扩展?。

这个答案看起来很有用:https://stackoverflow.com/a/21915845/4508593

 类似资料:
  • 我想我的nginx使显示所有网址的清洁。 http://www.mydomain.com/indexhtml.html像http://www.mydomain.com/indexhtml http://www.mydomain.com/indexphp.php像http://www.mydomain.com/indexphp 通过一些研究,我做了第一个案例。它通过以下配置完成: 它适用于index

  • 问题内容: 有什么方法可以使用PHP从JPG删除EXIF数据?我听说过PEL,但我希望有一种更简单的方法。我正在上传将在线显示的图像,并希望删除EXIF数据。 谢谢! 编辑:我不/不能安装ImageMagick。 问题答案: 使用重新创建图像的图形部分在一个新的,你保存 与另一名 。 参见PHP gd 编辑2017 使用新的Imagick功能。 开启图片: 确保在图像中保留所有ICC配置文件 然后

  • 问题内容: 题 如何在PHP中删除空的xml标记? 例: XML结果: 我想要的是! 不含空标签(如“ tag3”)的XML 谢谢! 问题答案: 您可以将XPath与谓词 一起使用,以选择所有没有子节点的元素。 版画

  • 问题内容: 我在从Codeigniter的URL中删除index.php时遇到问题。我使用Codeigniter 1.7制作了一些网站,而我使用的.htaccess代码在2版中不起作用。 我尝试使用 和 我也尝试了没有RewriteBase / in的情况。 我已经将$ config [‘uri_protocol’]更改为REQUEST_URI和QUERY_STRING,什么也没有。 我已经设置了

  • 问题内容: 如何从静态页面的网址中删除? 另外,我需要将任何网址重定向到没有该网址的网址。(即到)。 问题答案: 感谢您的答复。我已经解决了我的问题。假设我的页面在下,则适用以下.htaccess 规则。

  • 我想从我的用户表中删除一行当用户单击按钮时,用户需要登录并删除自己的帐户。 我回显了$user\u id,它显示“4”,这是登录用户的正确id,因此user\u id=$user\u id 这是网页我有它举行的按钮我要删除用户行在数据库