Need Help with .htaccess redirect one url to another with code

Discussion in 'Apache' started by Miguelmateos, Jul 16, 2011.

  1. #1
    ok here is the problem I have a site directory that I am redirecting to another site

    example old site
    /olddir/viewvideo?id=gPOfurmrjxo
    I need it to redirect to the new site/directory exactly the same
    http://www.newsite.com/newdir/viewvideo?id=gPOfurmrjxo

    I am using the following .htaccess code



    it iis redirecting the folder traffic to the new site only it redirects it like so

    http://www.newsite.com/newdir/?id=gPOfurmrjxo

    which cause's errors since it is missing the "viewvideo" in the url

    should redirect like this
    http://www.newsite.com/newdir/viewvideo?id=gPOfurmrjxo

    but for some reason everything before the ? is deleted there are other quieres like

    http://www.newsite.com/newdir/index?id=gPOfurmrjxo
    http://www.newsite.com/newdir/search?id=gPOfurmrjxo

    but the same thing when it is redirected it send directly to

    http://www.newsite.com/newdir/?id=gPOfurmrjxo

    without the viewvideo or index or search ect.

    what can I do to the .htaccess to recognize the words before the ? and carry it over exactly the same to the new domain or directory
     
    Miguelmateos, Jul 16, 2011 IP