【问题标题】:WordPress url parameters with ampersand result in a 404带有&符号的WordPress url参数导致404
【发布时间】:2017-10-19 10:41:03
【问题描述】:

我有一个 WordPress (4.7.5) 设置并尝试将一些 URL 参数传递到登录页面。

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

/landingpage/?ID=1779&name=james - 导致 404 错误页面

/landingpage/?ID=1779&name=james&company=microsoft - 导致 404 错误页面

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

感谢您的任何输入 x

【问题讨论】:

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


    【解决方案1】:

    您的问题不在于网址中的“与”。但它是查询参数“名称”。更改是更独特的,因为 Wordpress 具有您不应该在自定义查询中使用的默认查询参数。

    以下是您无法使用的默认 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
    )
    

    【讨论】:

    猜你喜欢
    • 2016-03-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多