[英]Redirect homepage to a different page using htaccess on a Drupal site
[英]htaccess redirect except homepage and language versions of the site
我有一個WordPress網站www.myoldsite.com
該網站的首頁上只有4個鏈接。
English - links to my new site www.mynewsite.com
French - links to www.myoldsite.com/fr
German - links to www.myoldsite.com/de
Russian - links to www.myoldsite.com/ru
我希望所有舊站點頁面都重定向到新站點的主頁,但該站點的主頁和語言版本除外。
www.myoldsite.com should not be redirected
www.myoldsite.com/fr should not be redirected
www.myoldsite.com/de should not be redirected
www.myoldsite.com/de should not be redirected
但正斜杠后的所有其他內容都應重定向到新網站的首頁。 即
www.myoldsite.com/page1
www.myoldsite.com/page2
等等都應該重定向到www.mynewsite.com。
誰能幫忙嗎?
以下是我的htaccess文件
# 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
您可以使用此站點生成重定向
http://www.rapidtables.com/web/tools/redirect-generator.htm
http://www.htaccessredirect.net/
或google .htaccess重定向代碼生成器
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.