SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Dec 2002
    0 Post(s)
    0 Thread(s)

    Mod_Rewrite Question

    hi folks. I'm a giant noob when it comes to mod_rewrite but I've got a question concerning M_R and SEO.

    What I'd like to do is have it so that when this URL is requested from the server:


    This is what is returned:


    I've been told that this is impossible and won't help with search engines. I was also told that I was approaching it from a backwards perspective and what I should be doing is setting it up so that when the user requests this URL:


    They actually get this:


    That doesn't really help me because then I would need to go through and hard-code all the links again. So I might as well have built a static site instead of a dynamic one.

    Can anyone shed some light on this M_R stuff. In a nutshell, what I'm trying to do is change practiceAreas.php?id=4 to medical-malpractice-lawyer.php in order to make the URL more search engine friendly.

    Thanks for any help.


  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    20 Post(s)
    3 Thread(s)

    The article at addresses this near the end. To summarize, though, it's definitely possible to do this EITHER way so long as you're taking the articles from your database with UNIQUE keys.

    In general, too, your way is the wasy way (except for displaying a URL taken from a database - a massive rewrite map would be required for Apache to make that switch) while the common way is for you to use the unique key to generate the URLs (NOT make massive changes to your website) which get redirected to a script to use that unique key to read and present data from that key's record.

    Clear as mud? Let's continue this discussion as this is likely to grow into a very useful thread!


    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Posting Permissions

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