For example I have a domain example.com
and server IP of 12.34.56.78
I need to point example.com
to a facebook page, then point 12.34.56.78
to my root directory where my website files are saved.
Here's my current Htaccess code
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteRule ^(.*)$ https://www.facebook.com/examplefbpage/
RewriteCond %{HTTP_HOST} ^12.34.56.78$
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
</IfModule>
# END WordPress
Currently, both example.com
and 12.34.56.78
redirects to the facebook page.
By the way, my site a created using wordpress.
Thanks in advance!