SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Guru
    Join Date
    Oct 2001
    Location
    USA
    Posts
    760
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Changing the structure of links

    On my site I have links like

    http://321webmaster.com/index/7/40

    How can I get them all to read like

    http://321webmaster.com/index/Free_S...RL_Redirection

    Thus replacing the sub cats and cats with their proper names instead of their identifying numbers?

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Oct 2001
    Location
    Vancouver BC Canada
    Posts
    2,017
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    You might find this article handy:
    http://www.devarticles.com/c/a/Apach...cer-Page-URLs/

    It was written about changing querystrings ie:
    www.example.com/index.php?pageID=12&tabID=2
    into
    www.example.com/about/principals

    Or something similar, but it might have some techniques you can use.
    Andrew Wasson | www.lunadesign.org
    Principal / Internet Development

  3. #3
    $this->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Dec 2003
    Location
    Federal Way, Washington (USA)
    Posts
    1,526
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You might also be interested in the SitePoint article titled Search Engine Friendly URLs. It has quite a few helpful pointers.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    Showcase your music collection on the Web

  4. #4
    SitePoint Guru
    Join Date
    Oct 2001
    Location
    USA
    Posts
    760
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    neither address this specific problem.

  5. #5
    $this->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Dec 2003
    Location
    Federal Way, Washington (USA)
    Posts
    1,526
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is a kind of half-formed idea, but how about constructing some sort of translation table? Something like:

    Element 1 = Category 1
    Element 2 = Category 2
    etc.

    I don't know exactly how you want it to function, but it could possibly involve a switch statement to decide on how to build the new URL and redirect accordingly.

    Does that help at all?
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    Showcase your music collection on the Web

  6. #6
    SitePoint Wizard bronze trophy
    Join Date
    Oct 2001
    Location
    Vancouver BC Canada
    Posts
    2,017
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    I think it's going to have to be handled by apache if it's going to be efficient. PHP is going to be too resource hungry if you have lots of traffic. You should be able to do some sort of module mod_ rewrite thing and handle it right at the http request.

    Have you checked with the apache folks in the Configure Your Server > Apache section?
    Andrew Wasson | www.lunadesign.org
    Principal / Internet Development


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
  •