URL Parsing on Apache or IIS

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • filesiteguy

    URL Parsing on Apache or IIS

    I am coming up with a new site, which will be community-driven and
    subscription-based. I would like for people to go ato a URL that is
    friendly and easy to remember.
    Let's say my domain is mydom.com. I am a new user who just registered
    newsite as my name. I want to load a PHP file, but call it something
    other than - say - default.php. In other words, I want to load a
    pagedefault.php file which will pull information from a database based
    on the user's name. There are not going to be user directories. (The
    user will have no ability to upload using FTP.)

    As I currently see it, I can do something like:


    What I'd like to do is something like:
    http://www.mydom.com/newsite/default.htm on the address bar of the
    browser. This will be parsed into the correct parameter
    (username=newsi te) and the correct page (default.php) will be loaded.
    I noticed one semi-related item here from a bit ago..



    This forum post describes the use of MOD_REWRITE.

    Ideas?


    Kai
    www.perfectreign.com - The Project Management Site
  • Andy Hassall

    #2
    Re: URL Parsing on Apache or IIS

    On Wed, 02 Jun 2004 13:09:24 -0700, filesiteguy <abuse@127.0.0. 1> wrote:
    [color=blue]
    >As I currently see it, I can do something like:
    >http://www.mydom.com/default.php?username=newsite
    >
    >What I'd like to do is something like:
    >http://www.mydom.com/newsite/default.htm on the address bar of the
    >browser. This will be parsed into the correct parameter
    >(username=news ite) and the correct page (default.php) will be loaded.
    >I noticed one semi-related item here from a bit ago..
    >
    >www.webmasterworld.com/forum88/421.htm[/color]

    Can't see it, need to register.
    [color=blue]
    >This forum post describes the use of MOD_REWRITE.[/color]

    I agree, use mod_rewrite.

    --
    Andy Hassall <andy@andyh.co. uk> / Space: disk usage analysis tool
    http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space

    Comment

    • John Dunlop

      #3
      Re: URL Parsing on Apache or IIS

      filesiteguy wrote:
      [color=blue]
      > I am coming up with a new site, which will be community-driven and
      > subscription-based. I would like for people to go ato a URL that is
      > friendly and easy to remember.[/color]

      Commendable, old boy.

      Persistency is another consideration. But I bet you've already
      thought of that and filed it under "friendly". Non-persistent URIs
      are surely unfriendly.

      [ ... ]
      [color=blue]
      > As I currently see it, I can do something like:
      > http://www.mydom.com/default.php?username=newsite
      >
      > What I'd like to do is something like:
      > http://www.mydom.com/newsite/default.htm on the address bar of the
      > browser.[/color]

      Good, that's definitely better; yet it could be improved upon. Why is
      "default.ht m" tacked on the end? I don't like it. Firstly, "default"
      isn't very descriptive. What information can a user gain from that
      part of the URI? Secondly, going back to the persistency principle,
      will your file still be HTML ten years down the line? Get rid of
      ".htm" too. Make it work with or without the www subdomain and the
      trailing slash, but be cache-friendly by being consistent with what
      you publish.

      What constraints are placed on site names? E.g., length, case,
      characters allowed, etc.

      [ ... ]
      [color=blue]
      > This forum post describes the use of MOD_REWRITE.[/color]

      See also <http://httpd.apache.or g/docs/misc/rewriteguide.ht ml>.

      --
      Jock

      Comment

      Working...