SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: ghost directory

  1. #1
    SitePoint Addict brain's Avatar
    Join Date
    Sep 2001
    Location
    Amsterdam
    Posts
    249
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ghost directory

    I have a CMS for links on my site, but I actually want the category to be seen within the URL without physically have to insert a new category on my site. So e.g. if I have a category Cardiology, I want the URL to be:

    www.mysite.nl/Cardiology/

    But the directory Cardiology doesn't actually exist. Am I making it clear?

  2. #2
    SitePoint Guru Ize's Avatar
    Join Date
    Nov 2005
    Location
    The Netherlands
    Posts
    808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You will have to use mod_rewrite, see http://www.workingwith.me.uk/article...ng/mod_rewrite for more

  3. #3
    Dinah-Moe Humm mudshark's Avatar
    Join Date
    Dec 2003
    Posts
    1,072
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Assuming you're grabbing the category from a database, in which case you have a catID for it, one (non php) solution would be mod_rewrite:

    Code:
    RewriteEngine On
    RewriteRule ^([0-9]+)/([-a-zA-Z]+)/?$ /category.php?catID=$1 [L]
    ... would rewrite example.com/1/Cardiology to example.com/category.php?catID=1


Bookmarks

Posting Permissions

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