Score:1

How to redirect using .htaccess in Apache

mn flag

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?

Rohit Gupta avatar
be flag
It seems to me that Google may not like this, if your content is different
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.