.htaccess help please

by 4 replies
5
Hey everyone I just wanted to wish everyone a happy new year.

My script sometimes auto refreshes when it certain games are played and it will have the same domain with the extension ?refresh=true

I was wondering if i could write an htaccess file that when the ?refresh=true comes up it reverts back to the original page

example:

www.domain.com/?refresh=true

to go to
www.domain.com

Thanks all!

Have a good night and a great new year!
#programming #htaccess
  • Why not in PHP...?
    It would maybe easier.
  • If you have mod_rewrite enabled, then this might help.

    Code:
    RewriteEngine On
    RewriteCond %{QUERY_STRING} refresh=true
    RewriteRule (.*) http://www.domain.com/$1? [R=301]
    Still, I agree using PHP would be easier..
  • Code:
    Options +FollowSymlinks
    RewriteEngine On
    RewriteCond %{QUERY_STRING} . 
    RewriteRule domain.com/?refresh=true /foo.php? [L]
  • maybe this php code will do it for you.

    just save this as a index.php file

    insert your domain and it should revert to whatever site you want.

    <?php
    header('Location: http://your domain name);
    ?>

    hope this helps...

    That's as technichal as it gets for me LOL

Next Topics on Trending Feed

  • 5

    Hey everyone I just wanted to wish everyone a happy new year. My script sometimes auto refreshes when it certain games are played and it will have the same domain with the extension ?refresh=true