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

Need some help with .htaccess to avoid duplicate content

Discussion in 'General Programming Chat' started by AllOutAnime, Jul 2, 2008.

  1. AllOutAnime

    AllOutAnime Jr. VIP Jr. VIP

    Joined:
    Oct 15, 2007
    Messages:
    212
    Likes Received:
    50
    Occupation:
    Coder
    Location:
    Localhost
    Hello, this is an url rewrite for my wiki page (site.com/wiki/article)

    Code:
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^wiki/(.*)$ w/index.php?title=$1 [PT,L,QSA]
    RewriteRule ^wiki/*$ wiki/ [L,QSA]
    RewriteRule ^/*$ wiki/ [L,QSA]
    Now here I got an url rewrite to avoid duplicate content:

    Code:
    RewriteCond %{HTTP_HOST} !^www.site.com$
    RewriteRule ^(.*)$ http://www.site.com/$1 [L,R=301]

    Can you somehow combine them in 1 .htaccess file? If I just put them together it doesen´t work.

    Thanks for your help.