【发布时间】:2015-07-25 23:30:15
【问题描述】:
我正在尝试将语言添加到我的 wordpress 网站。为此,我在“每个域”模式下使用“qTranslate X”插件。
它应该如下工作:
http://domain.com - main language
http://en.domain.com - english
etc...
我需要将所有请求从子域重定向到主域。其余的将由插件完成。
Example:
http://en.domain.com/category/article
should be redirected to
http://domain.com/category/article
我修改了主 .htaccess WP 文件
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^en\.domain\.com [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
但不幸的是,它仅适用于主页(即http://en.domain.com)。当我输入 http://en.domain.com/category/article 时,我看到 404 Not Found 页面。
感谢您的帮助!
【问题讨论】:
标签: wordpress .htaccess http-status-code-404 qtranslate-x