1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

.htaccess code

Discussion in 'Site & Server Administration' started by Toon-c, Dec 1, 2015.

  1. #1
    Hi guys,

    I'm running a new wordpress installation instead of my old html site.

    I have a lot of pages that have this structure

    www.domain.com/word.htm

    I want to redirect all these pages to tags under the new website

    so that previous URL will be redirected to www.domain.com/tag/word

    I know it's doable using .htaccess, but I just don't know how :)

    OR - is there a way to change the tag structure in wordpress to go from www.domain.com/tag/word to www.domain.com/word.htm

    Either way is fine for me.

    Any help will be appreciaed.

    Thanks
     
    Toon-c, Dec 1, 2015 IP
  2. Toon-c

    Toon-c Well-Known Member

    Messages:
    1,775
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    180
    #2
    Anybody ?
    Can someone move the thread to apache sub forum ?

    Thanks
     
    Toon-c, Dec 3, 2015 IP
  3. OlgaSeCom

    OlgaSeCom Active Member

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    56
    #3
    try to use these in the top of your .htaccess file:

    RewriteEngine on
    RewriteRule ^(.*).html$ http ://domain.com/tag/$1 [R=301,L]
     
    OlgaSeCom, Dec 3, 2015 IP
  4. Toon-c

    Toon-c Well-Known Member

    Messages:
    1,775
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    180
    #4
    Hi,

    thanks ..

    But wherever I put that (top/ middle / bottom) in the htaccess file, I get a internal server error ..

    This is the existent code in the htaccess file

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress
     
    Toon-c, Dec 3, 2015 IP
  5. OlgaSeCom

    OlgaSeCom Active Member

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    56
    #5
    just try to add
    RewriteRule ^(.*).html$ http ://domain.com/tag/$1 [R=301,L]
    after line
    RewriteRule . /index.php [L]
     
    OlgaSeCom, Dec 3, 2015 IP