我使用自托管wordpress并希望将访客从fashionbeautyetc.com重定向到fayekent.co.uk上的相应页面/帖子。我希望排除应用于图像的重定向和WP仪表板(wp-admin)我应该在htaccess中放置什么代码
下面的代码如下:
SuPHP_ConfigPath /var/sites/f/fashionbeautyetc.com/public_html
# 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
答案 0 :(得分:2)
在# BEGIN WordPress
:
RewriteCond %{HTTP_HOST} ^(www\.)?fashionbeautyetc\.com$ [NC]
RewriteCond %{REQUEST_URI} !\.(jpe?g|png|gif|ico)$ [NC]
RewriteCond %{REQUEST_URI} !wp-admin
RewriteRule ^(.*)$ http://fayekent.co.uk/$1 [L,R=301]