%-encode error redirecting on mod_alias

Discussion in 'Apache' started by MatyX, Sep 3, 2006.

  1. #1
    Hi guys!
    I've a problem using Redirect directive.

    I want to do the following:

    * Take every http-request that matches a regex and redirect it to another page, but passing the requested url as variable. For example,

    I have the rule (in .htaccess):

    RedirectMatch ^(.*)\.txt http://myServer/ShowText.php?$1

    Request: http://myServer/PageName.txt

    The new Request would be: http://myServer/ShowText.php?PageName.txt

    but, a forbidden (403) error appears.


    I realize that the problem is in the ? symbol. It's %-encoded, so Apache is trying to access to an invalid file. I tried solve this using mod_rewrite and it works fine, but i prefer to use Redirect.



    Any solution ?


    Thank you very much.
     
    MatyX, Sep 3, 2006 IP