【发布时间】:2017-10-26 13:16:44
【问题描述】:
我的网站一次又一次地显示 404 页面未找到。永久链接更改后,它运行良好一段时间然后再次显示相同的错误。
我尝试过的步骤:
- 固定链接已更改
- .htaccess 编辑
- 清除缓存
- 将 .htaccess 文件设为只读。
调试后我发现了这个
我的重写规则自动改变:
(.?.+?)(?:/([0-9]+))?/?$ index.php?pagename=$matches[1]&page=$matches[2]强>
规则:
([^/]+)(?:/([0-9]+))?/?$ index.php?name=$matches[1]&page=$matches[2]强>
工作代码的匹配规则
匹配规则:(.?.+?)(?:/([0-9]+))?/?$ 匹配查询:pagename=aboutus&page= 查询字符串:pagename=aboutus&debug-this=rewrites
匹配错误规则(自动更改)代码
匹配规则:([^/]+)(?:/([0-9]+))?/?$ 匹配查询:name=aboutus&page= 查询字符串:name=aboutus&debug-this=rewrites ([^/]+)(?:/([0-9]+))?/?$ index.php?name=$matches[1]&page=$matches[2]
【问题讨论】:
标签: php wordpress .htaccess mod-rewrite