Newbie needs help with htaccess. duplicate pages appear in search

Discussion in 'Apache' started by verticalretreat, Jun 3, 2010.

  1. #1
    Ok. My problem is I just re-done my website. Not even 30 minutes after uploading my pages already appear in the search engine.

    The link format on my site looks like this

    http://www.site.com/index.php/q=some+word+here
    http://www.site.com/index.php/q=some+word+here&page=2

    but the way it appears in the search engine is like this:

    http://www.site.com/q=some+word+here
    http://www.site.com/q=some+word+here&page=2


    Can someone please tell me how to do a htaccess rewrite for this.

    I tried these but they did not work.


    RewriteEngine On
    RewriteCond %{QUERY_STRING} q=(.*)
    RewriteRule /?q=(.*)$ /index.php/q=(.*)? [R=301,L]

    RewriteEngine On
    RewriteCond %{QUERY_STRING} q=([^/.]+)
    RewriteRule /?q=([^/.]+)$ /index.php/q=(.*)? [R=301,L]
     
    verticalretreat, Jun 3, 2010 IP
  2. ShakataGaNai

    ShakataGaNai Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    That'll rewrite /index.php/q=asdf into /q=asdf
     
    ShakataGaNai, Jun 7, 2010 IP