简体   繁体   English

如何在Wordpress中使用mod_rewrite?

[英]How to use mod_rewrite with Wordpress?

I'm running a wordpress installation on the root dir of my website test.com Wordpress is using url's like: test.com/information/ and I also added some custom parameters like: test.com/information/?about=product 我正在我的网站test.com的根目录上运行wordpress安装Wordpress使用的是URL,例如:test.com/information/,并且还添加了一些自定义参数,例如:test.com/information/?about=product

I tried to use the mod-rewrite generator at http://www.generateit.net/mod-rewrite/ to change my custom urls to test.com/information/about/product but keep receiving a wordpress 404 error. 我尝试使用http://www.generateit.net/mod-rewrite/上的mod-rewrite生成器将自定义网址更改为test.com/information/about/product,但始终收到wordpress 404错误。

Is there a solution to my problem? 我的问题有解决方案吗?

All answers wrong. 所有答案都错了。 Login to admin area. 登录到管理区域。 On the left menu, under settings find permalinks . 在左侧菜单中,在设置下找到permalinks You can choose or add proper settings there. 您可以在那里选择或添加适当的设置。

我同意@borayeris-WordPress在“设置”下有其自己的永久链接页面-使用该页面。

If you are already using pretty permalinks, make an about page then make it the parent page of all your product pages. 如果您已经使用了非常永久链接,请创建一个about页面,然后将其设置为所有product页面的父页面。

Or use the rule: 或使用规则:

RewriteRule ^information/about/([^/]+)/?$ information/?about=$1 [L,NC]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM