URL rewriting via Wordpress Rewrite or .htaccess

后端 未结 4 1425
离开以前
离开以前 2020-12-03 02:10

JUMP TO EDIT8 TO SEE HOW I SOLVED THIS


Let\'s say I have a Wordpress blog: www.animals.com. I have a certain PHP file in my t

4条回答
  •  时光说笑
    2020-12-03 02:29

    URL rewriting wouldn't work for me, neither by calling add_filter('rewrite_rules_array', function() {}), nor by calling add_rewrite_rule(). Apparently that was because filter 'rewrite_rules_array' was never triggered when opening frontend website pages, so the rewrites weren't generated.

    The solution was to go to admin area and just open page Settings -> Permalinks. I need to do that every time I want to change my rewrites.

    I don't know if vanilla Wordpress works like that, this is probably caused by an plugin/theme a have installed.

提交回复
热议问题