Redirect only landing page with htaccess

In order to consolidate back link credit, and avoid penalties for duplicate page content, I would like to redirect requests for www.mauitradewinds.com to mauitradewinds.com   However, I don't want to redirect requests for other pages in the domain, only the landing page or root page.  There are scripts within subdirectories on my site which require the www prefix.   Please provide .htaccess code which will permanently redirect only the landing page.
LVL 1
ddantesAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Patrick BogersDatacenter platform engineer LindowsCommented:
Hi,

You could have this code generated automatically, please try here.
0
GaryCommented:
Try this

RewriteCond %{HTTP_HOST} ^(www\.)?mauitradewinds\.com [NC]
RewriteRule ^$ http://mauitradewinds.com [NC,R=301]

Open in new window

0
ddantesAuthor Commented:
Thank you both for comments.

GaryC123:  Here is the complete .htaccess, including the code which was just added.  The root page no longer opens,  with or without www...


<IfModule mod_rewrite.c>
  Options +FollowSymlinks
  RewriteEngine On

  # Adaptive-Images -----------------------------------------------------------------------------------

  # Add any directories you wish to omit from the Adaptive-Images process on a new line, as follows:
  RewriteCond %{REQUEST_URI} !js
  RewriteCond %{REQUEST_URI} !css
  RewriteCond %{REQUEST_URI} !scgi
  RewriteCond %{REQUEST_URI} !secure  
  RewriteCond %{REQUEST_URI} !assets
  RewriteCond %{REQUEST_URI} !images/view.jpg
  RewriteCond %{REQUEST_URI} !images/StWVT.jpg
  RewriteCond %{REQUEST_URI} !images/StWVTsmall.jpg
  RewriteCond %{REQUEST_URI} !images/TdwVT.jpg
  RewriteCond %{REQUEST_URI} !images/TdwVTsmall.jpg

  # don't apply the AI behaviour to images inside AI's cache folder:
  RewriteCond %{REQUEST_URI} !ai-cache
   
  # Send any GIF, JPG, or PNG request that IS NOT stored inside one of the above directories
  # to adaptive-images.php so we can select appropriately sized versions
 
  RewriteRule \.(?:jpe?g|gif|png)$ adaptive-images.php

  # END Adaptive-Images -------------------------------------------------------------------------------
</IfModule>


RewriteEngine On
RewriteBase /

# redirect index.htm to the root domain
RewriteRule ^index\.htm$ / [NC,R,L]


RewriteCond %{HTTP_HOST} ^(www\.)?mauitradewinds\.com [NC]
RewriteRule ^$ http://mauitradewinds.com [NC,R=301]
0
Newly released Acronis True Image 2019

In announcing the release of the 15th Anniversary Edition of Acronis True Image 2019, the company revealed that its artificial intelligence-based anti-ransomware technology – stopped more than 200,000 ransomware attacks on 150,000 customers last year.

GaryCommented:
I'm looking at the site and it seems to be working fine.
0
GaryCommented:
Remove the L from
RewriteRule ^index\.htm$ / [NC,R,L]
0
ddantesAuthor Commented:
I get a server access error after making that change.  I'm not leaving that .htaccess online, so the site may appear to be working.
0
GaryCommented:
Try this, there was a mistake

RewriteCond %{HTTP_HOST} ^www\.mauitradewinds\.com [NC]
RewriteRule ^$ http://mauitradewinds.com [NC,R=301] 

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ddantesAuthor Commented:
That did it.  Many thanks, Gary.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.