1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

htaccess question

Discussion in 'BlackHat Lounge' started by BuzzKill, Jan 9, 2008.

  1. BuzzKill

    BuzzKill Executive VIP

    Joined:
    Aug 30, 2007
    Messages:
    508
    Likes Received:
    173
    Occupation:
    Entrepreneur
    Location:
    Milwaukee WI
    what do i need to put in my htaccess file to make any of the .htm pages direct to and .html page, might not make sense but it has to do with a shitload of .htm pages being indexed that dont exist anymore.
     
  2. SmallStorm

    SmallStorm Junior Member

    Joined:
    Dec 4, 2007
    Messages:
    141
    Likes Received:
    64
    Hi BuzzKill,

    Try the below code:

    Code:
    Options +FollowSymlinks
    RewriteEngine on
    RewriteRule ^(.*)\.htm $1.html [nc]
    
    But if you want the search engines to reflect new pages as being indexed as .html files, then you will need to do something different. You will have to actually Perm. redirect them. Try this code below:

    Code:
    Options +FollowSymlinks
    RewriteEngine on
    RewriteRule ^(.+)\.htm http://YOURDOMAIN.COM/$1.html [r=301,nc]
    Replace YOURDOMAIN.COM with your domain name.

    NOTE: If you get a 500 internal error or something after putting in the code, try taking out Options +FollowSymlinks and see if it works. It may already be enabled on your server but disallowed in .htaccess.


    Let us know if that works.

    Chris
     
  3. pracownik

    pracownik Newbie

    Joined:
    Dec 17, 2007
    Messages:
    33
    Likes Received:
    4
    you can try online generator ex: http://www.southeasttelephone.com/tools/htAccessor/htaccessor.php