Mod Rewrite every URL expecting one

  • Hi..
    I'm fighting with ModRewrite and i didn't find the correct solution.
    I need a Redirect for every URL of a domain but one dynamic url should word on the old url.
    The exsample...

    Code
    1. http://my-domain.tld/......


    This should be redirected to the new URL like

    Code
    1. my_newdomain.tld/infopage.html


    If a user comes with this url

    Code
    1. http://my-domain.tld/index.php?type=winner&parm=


    it should still work on the old url. The parm is variable...


    I'd started with this

    Code
    1. RewriteEngine On
    2. RewriteCond %{REQUEST_URI} !^/index\.php [NC]
    3. RewriteRule ^(.*)$ http://my_newdomain.tld/infopage.html [L,R=301]


    This works... But if add the rest in this RewriteCond all will be redirected...
    I hope someone can help me with this problem


    Thanks

    Edited once, last by TheCry ().

  • Well, he want to redirect all Pages to a new URL except one!
    This expected url only should redirect so a new specified Url.
    The res should go the normal way...hope i understand it the right way ;)


    Greez BeNe

  • Ok..
    Every url from the old domain should be redirected to the new url. This is a fixed site.
    But only one url with params should be still work on the old domain...
    Here a try of me

    Code
    1. RewriteEngine On
    2. RewriteCond %{REQUEST_URI} !^/index\.php$
    3. RewriteRule ^(.*)$ http://my-newdomain.tld/infopage.html [L,R=301]
    4. RewriteCond %{QUERY_STRING} !^type=winner&parm=(.*)$
    5. RewriteRule ^(.*)$ http://my-newdomain.tld/infopage.html [L,R=301]


    It works in my tests. Maybe someone has a better solution


  • Hi fluser...
    Thanks for your try but it doesn't work...
    I'd cleared my cache and tested it...
    This rule will redirect the url which should work on the old domain and the new url will be append with
    $?type=winner&parm=2
    That's what i enter on the old url...


    If i switch back to my regexp it works but the new url will be append with
    ?type=winner&parm=2
    if i enter a wrong param or file (index2.php)

  • Don't understand me wrong!
    If i enter index2.php the redirect should work!
    Only index.php?type=winner&parm= should work on the old domain!


    But if the redirect works it will apend my new domain with the parameters. And i dont want to have that!