带有&符号的WordPress url参数导致404

时间:2017-05-19 10:30:02

标签: wordpress url parameters http-status-code-404

我有一个WordPress(4.7.5)设置,并尝试将一些网址参数传递到目标网页。

/landingpage/?ID=1779&name=james - 按预期工作

/landingpage/?ID=1779&name=james&company=microsoft - 404错误页面中的结果

{{1}} - 404错误页面中的结果

我的问题是为什么'&'结果是404,我该如何解决这个问题?

感谢您输入x

1 个答案:

答案 0 :(得分:1)

您的问题不在您的网址中的“&符号”上。但它是查询参数“name”。更改变得更加独特,因为Wordpress具有您不应在自定义查询中使用的默认查询参数。

Bellow是您无法使用的默认wordpress查询变量。

Array
(
    [error] => 
    [m] => 
    [p] => 0
    [post_parent] => 
    [subpost] => 
    [subpost_id] => 
    [attachment] => 
    [attachment_id] => 0
    [name] => 
    [static] => 
    [pagename] => 
    [page_id] => 0
    [second] => 
    [minute] => 
    [hour] => 
    [day] => 0
    [monthnum] => 0
    [year] => 0
    [w] => 0
    [category_name] => 
    [tag] => 
    [cat] => 
    [tag_id] => 
    [author] => 
    [author_name] => 
    [feed] => 
    [tb] => 
    [paged] => 0
    [meta_key] => 
    [meta_value] => 
    [preview] => 
    [s] => 
    [sentence] => 
    [title] => 
    [fields] => 
    [menu_order] => 
    [embed] => 
    [category__in] => Array
        (
        )

    [category__not_in] => Array
        (
        )

    [category__and] => Array
        (
        )

    [post__in] => Array
        (
        )

    [post__not_in] => Array
        (
        )

    [post_name__in] => Array
        (
        )

    [tag__in] => Array
        (
        )

    [tag__not_in] => Array
        (
        )

    [tag__and] => Array
        (
        )

    [tag_slug__in] => Array
        (
        )

    [tag_slug__and] => Array
        (
        )

    [post_parent__in] => Array
        (
        )

    [post_parent__not_in] => Array
        (
        )

    [author__in] => Array
        (
        )

    [author__not_in] => Array
        (
        )

    [ignore_sticky_posts] => 
    [suppress_filters] => 
    [cache_results] => 1
    [update_post_term_cache] => 1
    [lazy_load_term_meta] => 1
    [update_post_meta_cache] => 1
    [post_type] => 
    [posts_per_page] => 10
    [nopaging] => 
    [comments_per_page] => 50
    [no_found_rows] => 
    [order] => DESC
)