How to fix index.php?... duplicating issues

Discussion in 'HTML & Website Design' started by carljohn, Sep 14, 2008.

  1. #1
    Hi,

    I previously set up an auto-video site for a domain, but now i've decided to change the whole site with new contents. Here is the problem, how do i redirect these non-existent pages back to my homepage? I've countless of such pages indexed by google:
    /index.php?page=10&tag=xxxx&tag_type=keyword‎

    If i visit www.mydomain.com/index.php?page=10&tag=xxxx&tag_type=keyword‎ and many many others similar URL, although the page is no longer available, it will still show my homepage content. These has created many duplicated pages of my homepage.

    For some reason, i would still like to keep the index.php?... types of URL, i just want to redirect those pages that are no longer available. Can someone help me here? Thanks!
     
    carljohn, Sep 14, 2008 IP
  2. justinlorder

    justinlorder Peon

    Messages:
    4,160
    Likes Received:
    61
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It is such long a post. I don't know the reason clearly .
    But I can suggest that pay attention to the varibles. Are there the differnet varibles with the same name ?

    I have encounter a weird problem. I placed the new google analytic code into my asp page to track site.
    The page display an error. But if I remove the anlytic code, the page works well . That is weird.
     
    justinlorder, Sep 14, 2008 IP
  3. carljohn

    carljohn Peon

    Messages:
    36
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Can anyone give me the .htaccess code where i can redirect all /index.php?page=........ back to my homepage? Only those pages that had "page=" behind index.php?

    Thanks!
     
    carljohn, Sep 14, 2008 IP
  4. carljohn

    carljohn Peon

    Messages:
    36
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I've found this
    RewriteCond %{THE_REQUEST} ^[^/]+/index\.php(\?[^\ ]*)?\ HTTP/ [NC]
    RewriteRule index\.php$ /? [NC,R=301,L]

    Above code redirect all /index.php? back to homepage. Can anyone give me exact code to redirect only the URL that has (.../index.php?page=...) the page= on it?

    Thank you!
     
    carljohn, Sep 14, 2008 IP