Utilizing HTACCESS and PHP for Directory Redirects?

Discussion in 'Programming' started by refined, Mar 31, 2008.

  1. #1
    Hey everyone..

    so I need to create something like this:

    www.mydomain.com/whatever-directory/
    will actually load "index.php?blah=whatever-directory"

    But it will appear as though it is on the whatever-directory folder.

    How can you do this in HTACCESS? I know how to set it up in PHP (maybe it can be done in PHP?)

    Any help would be awesome..
     
    refined, Mar 31, 2008 IP
  2. refined

    refined Peon

    Messages:
    476
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
  3. jakomo

    jakomo Well-Known Member

    Messages:
    4,262
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    138
    #3
    Hello,
    Try it:

    RewriteRule ^([^/]+)/
    $ /index.php?blah=$1

    Best regards,
    Jakomo
     
    jakomo, Apr 1, 2008 IP