문제

I use self hosted wordpress and wish to redirect visitors from fashionbeautyetc.com to corresponding page/post on fayekent.co.uk. I wish to exclude the redirect being applied to images and the WP dashboard (wp-admin) what code should I place in htaccess

the code already in there is below:

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   
도움이 되었습니까?

해결책

Add this before # 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]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top