Dismiss Notice
Welcome to Our Community
Wanting to join the rest of our members? Feel free to sign up today.

PHP or mod_rewrite?

Discussion in 'Programming' started by BlueBoden, Jan 16, 2009.

  1. BlueBoden

    BlueBoden New Member Webmaster

    I would recommend that you use mod_rewrite, its actually very easy to enable such, not always important though.

    RewriteEngine on
    RewriteRule ^Articles/([0-9]+)/$ /?AID=$1
    The parentheses simply creates a back-reference, or "remembers" the match, the "+" allows at least 1 digit to be present. The /?AID=$1 part is the real URL relative to the root. See also: Absolute and Relative Paths

    The URL should of cause be unique, so it would be best either simply to use a number like in above example, or to include the exact date as part of the URL, or as a sub-directory.

    Note, its not really that important to have "readable" URLs, only very few users actually use them. And it raises a number of issues since the URLs still need to be unique, which can't always be assumed.
    Last edited by a moderator: Jan 16, 2009
  2. .amaZe

    .amaZe New Member Webmaster

    mod_rewrite would be easier..
  3. jitendraag

    jitendraag Member Webmaster

    I agree that mod_rewrite would be easier. You just need to make sure that when you 'generate' hyperlinks, they are generated in 'pretty url' mode :)

Featured Resources (View All)

Share This Page