【发布时间】:2014-12-04 18:42:24
【问题描述】:
您好,我有一个网址:http://www.couponvenue.in/store/myntra/ 我如何将网址更改为http://www.couponvenue.in/myntra.html。我尝试使用 .htacess 代码,这是我在网上搜索后发现的。
.htaccess 代码如下所示:
重写规则 ^(.*).html$ /store/$1 [L]
上述规则规定,如果我输入 URL:http://www.couponvenue.in/myntra.html,这将尝试打开 URL:http://www.couponvenue.in/store/myntra
我已经在核心 php 文件中尝试过它并且工作正常,但是当我在 wordpress 站点 http://www.couponvenue.in/store/myntra/ 中使用相同的代码时,它给了我 404 错误,请建议我怎样才能让它在我的 wordpress 站点中运行。
我正在使用带有 Clipper 主题的 WordPress 4.0.1。永久链接的当前设置设置为“帖子名称”,将我的商店 URL 显示为http://www.couponvenue.in/store/myntra/,但是当我将永久链接设置为默认设置时,它显示我的商店 URL:http://www.couponvenue.in/?stores=myntra。
我已经尝试过 Yoast 的插件 WordPress SEO 但没有成功
请建议我怎样才能创建像 http://www.couponvenue.in/myntra.html 这样的 URL 而不是 http://www.couponvenue.in/store/myntra/ 或 http://www.couponvenue.in/?stores=myntra 另外请让我知道规则 RewriteRule 中有什么问题 ^(.*).html$ /store/$1 [L]
【问题讨论】:
-
你使用 Woocommerce 吗?你真的需要删除它或重命名它就足够了吗?
标签: wordpress url for-loop customization store