简体   繁体   English

WordPress和htaccess重定向到另一个URL

[英]Wordpress and htaccess redirect to another url

Struggling with Wordpress and redirects! 苦苦于Wordpress和重定向!

I have a wordpress site which is only used (at the moment anyway) to provide url shortening, fangating for Facebook, provide tab pages for Facebook pages etc. ie I don't use or want any of the 'normal' Wordpress blog functionality. 我有一个wordpress网站,该网站仅用于(无论如何此刻)提供url缩短,为Facebook定位,为Facebook页面提供标签页等。即,我不使用或不需要任何“正常”的Wordpress博客功能。

To make life easier I want to redirect 为了让生活更轻松,我想重定向

http://mywordpressurl to https://facebook.com/myfanpage 

but I don't want to redirect anything else such as 但我不想重定向其他任何内容,例如

http://mywordpressurl/shorturl

I need those to be handled normally by Wordpress. 我需要由Wordpress正常处理的内容。

Wordpress has it's existing rewrite rules: 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>

Can I modify these to achieve what I want or can anyone suggest another way of achieving what I want? 我可以修改这些内容以实现我想要的吗,或者有人可以建议另一种方式实现我想要的吗? I've tried... but failed :( 我已经尝试过...但是失败了:(

Many thanks! 非常感谢!

在其他重写规则之前添加此代码:

RewriteRule ^$ https://facebook.com/myfanpage [R=301,L]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM