URL Parsing on Apache or IIS

This is a discussion on URL Parsing on Apache or IIS within the PHP Language forums, part of the PHP Programming Forums category; I am coming up with a new site, which will be community-driven and subscription-based. I would like for ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-02-2004
filesiteguy
 
Posts: n/a
Default 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:
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=newsite) 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

This forum post describes the use of MOD_REWRITE.

Ideas?


Kai
www.perfectreign.com - The Project Management Site
Reply With Quote
  #2 (permalink)  
Old 06-02-2004
Andy Hassall
 
Posts: n/a
Default Re: URL Parsing on Apache or IIS

On Wed, 02 Jun 2004 13:09:24 -0700, filesiteguy <abuse@127.0.0.1> wrote:

>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=newsite) 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


Can't see it, need to register.

>This forum post describes the use of MOD_REWRITE.


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
Reply With Quote
  #3 (permalink)  
Old 06-03-2004
John Dunlop
 
Posts: n/a
Default Re: URL Parsing on Apache or IIS

filesiteguy wrote:

> 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.


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.

[ ... ]

> 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.


Good, that's definitely better; yet it could be improved upon. Why is
"default.htm" 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.

[ ... ]

> This forum post describes the use of MOD_REWRITE.


See also <http://httpd.apache.org/docs/misc/rewriteguide.html>.

--
Jock
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 08:28 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0