【问题标题】:Friendly links not working with get array友好链接不适用于获取数组
【发布时间】:2019-08-09 13:45:57
【问题描述】:

我得到了 htaccess,但它不工作并且 $_GET 是空的。 我有链接http://localhost:3000/?noCalc=14b4daaf66cd5e99403985bd85a4bf62 我需要http://localhost:3000/noCalc/14b4daaf66cd5e99403985bd85a4bf62 有人知道吗?

<IfModule mod_rewrite.c>
Options +FollowSymLinks
Options -MultiViews
Options -Indexes
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /kalkulator/services/calculate.php
RewriteRule ^noCalc/([^/]*)$ /?noCalc=$1 [QSA,L]
</IfModule>

【问题讨论】:

    标签: .htaccess friendly-url


    【解决方案1】:

    $_GET noCalc 在 index.php (/?noCalc) 中还是在 /kalkulator/services/calculate.php 中?我改变了规则的顺序,请检查:

    <IfModule mod_rewrite.c>
        Options +FollowSymLinks
        Options -MultiViews
        Options -Indexes
        RewriteEngine On
        RewriteBase /
        RewriteRule ^noCalc/(.*)$ /?noCalc=$1 [L]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule . /kalkulator/services/calculate.php [L]
    </IfModule>
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-19
    • 2017-10-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多