1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

htaccess question - simple redirect

Discussion in 'Off Topic' started by Chimpie, Sep 20, 2012.

  1. Chimpie

    Chimpie Well-Known Member

    For some reason my brain is not figuring this out.

    I need a redirect for my htaccess so that any file or directory attempting to be accessed in my domain.com/whatever directory is sent to a single php page. For example...

    www.domain.com/whatever/misc.php is redirected to www.domain.com/blank.php
    domain.com/whatever is redirected to domain.com/blank.php
    domain.com/whatever/thissucks is redirected to domain.com/blank.php

    I tried:

    Redirect 302 /whatever/ http://www.domain.com/blank.php

    but if someone tries to access /whatever/duh, it goes to domain.com/blank.phpduh

  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    RewriteEngine On
    RewriteRule ^whatever.*$ http://www.domain.com/blank.php? [R=302,L]
    gordy and Chimpie like this.

Share This Page