redirection based on subdomain and url?

Discussion in 'Apache' started by feketegy, Oct 1, 2006.

  1. #1
    Okay, i have the following problem.I managed to do subdomain redirection, I set up a wildcard subdomain in apache so every subdomain forward to index.php

    ex. http://join.mysite.com -> index.php where it parses the http_host and redirects it to join.php
    http://news.mysite.com ->index.php parses to news.php

    okay, the problem is that how i manage to do like this:
    http://news.mysite.com/article/2 to redirect to news.php and in that file it parses then pulls out article2 from a database?

    in essence i want that everything after the slash(/) to be ignored and to be parsed in the 'subdomain' files?
    If i write http://news.mysite.com/article/2 then apache gives me an error that the file doesn't exist, but i simply want to redirect it to news.php than in this file i parse /article/2

    is this possible?
     
    feketegy, Oct 1, 2006 IP