WordPress rewrite url to index.php

Inside my .htaccess file, my default code is like this:

# 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

What I want to do is when I open mydomain.com it will redirect me to mydomain.com/?page_id=2 (but the url remain as mydomain.com ). How should I do that?

Related posts

Leave a Reply

1 comment

  1. Please put this in your .HTACCESS file:

    RewriteEngine On

    RewriteRule ^$ /?page_id=2 [L]

    EDIT:

    Also you can set this from your WordPress administration page: Go to Settings -> Reading and at “Front page displays” set as “A static page (select below)” and select from the dropdown list of “Front page:” your page.