HTML redirect question..........

3 replies
I have an HTML site and one of the major search engines has my site indexed as:

www.mysite.org/index.htm

I would like those who click on my link on the search engine to be redirected to:

http://www.mysite.org

I already have an .htaccess file in the root that redirects the non-www to the www but I don't know what I need to add to the .htaccess file to get www.mysite.org/index.htm to redirect to http://www.mysite.org
#html #question #redirect
  • Profile picture of the author Ben Nash
    Is this what you're looking for?

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.html -f
    RewriteRule ^(.*)$ $1.html
    {{ DiscussionBoard.errors[8986229].message }}
    • Profile picture of the author Jeff Gibson
      Originally Posted by Ben Nash View Post

      Is this what you're looking for?

      RewriteEngine on
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME}.html -f
      RewriteRule ^(.*)$ $1.html
      Thanks for information but it won't redirect properly. Right now I have this in my .htaccess file to redirect the non-www to the www which is working but I also need to redirect www.mysite.org/index.htm to to www.mysite.org

      RewriteEngine On
      RewriteCond %{HTTP_HOST} ^mysite.org& [NC]
      RewriteRule ^(.*)$ http://www.mysite.org/$1 [R=301,L]
      Signature

      {{ DiscussionBoard.errors[8986653].message }}
      • Profile picture of the author Farish
        Originally Posted by Jeff Gibson View Post

        Thanks for information but it won't redirect properly. Right now I have this in my .htaccess file to redirect the non-www to the www which is working but I also need to redirect www.mysite.org/index.htm to to www.mysite.org

        RewriteEngine On
        RewriteCond %{HTTP_HOST} ^mysite.org& [NC]
        RewriteRule ^(.*)$ http://www.mysite.org/$1 [R=301,L]
        RewriteRule ^index\.htm$ http://www.mysite.com/ [L,R=301]
        {{ DiscussionBoard.errors[8988620].message }}

Trending Topics