【问题标题】:I have to remove ".php",''?id","?another_id" from url in php by .htaccess我必须通过 .htaccess 从 php 中的 url 中删除 ".php",''?id","?another_id"
【发布时间】:2017-12-16 13:39:17
【问题描述】:

我使用此链接I want to remove question mark & .php extension from the url using .htaccess 删除“.php”和“?id”。 但是如果我在 url 中有“?another_id”怎么办?

【问题讨论】:

标签: .htaccess


【解决方案1】:

将此代码放在您的 .htaccess 文件中,它将删除 .php

RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L]

【讨论】:

    猜你喜欢
    • 2020-10-02
    • 1970-01-01
    • 2013-05-09
    • 2017-08-11
    • 2013-04-01
    • 2013-04-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多