我有一个url / nl /太阳镜,这是qtranslate的翻译页面。我想把它改成/ zonnebrillen。我不喜欢在wordpress中更改它,因为'太阳镜'是由插件wp-ecommerce和硬编码生成的。 我可以使用mod_rewrite使/ nl /太阳镜成为/ zonnebrillen。我怎样才能让wordpress'知道'来显示相应的页面?
干杯!
答案 0 :(得分:0)
这是我在获取WP以在URL中包含“name”作为查询var的查询变量后修改的一些代码。我包括常规WP安装发布的“原始”.htaccess文件以显示上下文。我已经将重写分开,以避免在WP更新时或“某些管理功能”导致其更改时出现问题。附:我没有对此进行测试,但类似的代码适用于更复杂的页面重定向...所以试试吧。让我知道如果它不适合你,我会测试它。
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^nl/sunglasses/ /zonnebrillen [NC,L]
</IfModule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
应该使用WP 3.4 +