1

I am using the following .htaccess rules to redirect the url for following conditions:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^$ https://example.com/page.php [L,R=301]
  1. If user enters "https://example.com", he is redirected to "https://example.com/page.php".
  2. If user enters "www.example.com", he is not redirected to "https://example.com/page.php" but regular "index.php".

Now the issue is, if the user only enters "example.com", he should not be redirected to "https://example.com/page.php" but "index.php".

How can I achieve this functionality?

1
  • It seems to me that Google may not like this, if your content is different Apr 11 at 9:02

0

You must log in to answer this question.

Browse other questions tagged .