Nigel
Nigel

Reputation: 175

Wordpress and htaccess redirect to another url

Struggling with Wordpress and redirects!

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. i.e. I don't use or want any of the 'normal' Wordpress blog functionality.

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

<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!

Upvotes: 1

Views: 1270

Answers (1)

Max
Max

Reputation: 1525

Add this ahead of the other rewrite rules:

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

Upvotes: 1

Related Questions