treehouse : what would you like to learn today?
Web Design Web Development iOS Development

htaccess file to redirect to a script

  • Hi Everyone

    I'm trying to write an .htaccess rule to redirect to a script, which further redirects somewhere else. However, I don't want the address url to change during the .htaccess part of the redirect.


    Example:
    test.mytest.com/page/test/hello
    this page should be hanlded by test.mytest.com/environment_test.php
    but test.mytest.com/page/test/hello still appears in browser.


    Thanks for reply in advance
  • RewriteEngine On
    RewriteBase /

    RewriteRule page/test/hello enviornment_test.php


    You might want to read some basic htaccess tutorials. Almost ANY tutorial you find (even bad ones) will clearly explain at least this much.