Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Brisbane, Australia
    Posts
    181
    Thanks
    1
    Thanked 0 Times in 0 Posts

    HtAccess Redirects

    For the people who use HTACCESS..

    I know there is a function/handler built into htaccess that will do the following.


    If the url contains:

    the htaccess file looks something like this
    (i'm guessing with regular expressions).

    Code:
    [SOMETHING HERE] /html/(.*)/(.*).html pages.php?directory=$1&page=$2
    you are actually viewing the file (but dont know it):

    pages.php?directory=xyz/csv&page=welcome

    Someone please; how do you do this?
    -mR_eGo
    _______________________
    Programming since
    3 years old.

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,108
    Thanks
    11
    Thanked 101 Times in 99 Posts
    google for mod_rewrite which is what you are looking for (there are examples in the apache manual)

    or if you were using PHP or similar you could utilise the $_SERVER['PATH_INFO'] variable to do similar which is probably less of a resource sucker than mod_rewrite
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •