Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 312987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:04:00+00:00 2026-05-12T08:04:00+00:00

I’ve always found that defining URLs for other pages in a Web Application seems

  • 0

I’ve always found that defining URLs for other “pages” in a Web Application seems either clumbsy and fragile or bloated.

E.g. you have an application that manages customers, sales, prospects and thus has the following “pages”.

  • customerlist
  • viewcustomer
  • editcustomer
  • addcustomer
  • viewcontact
  • editcontact
  • addcontact
  • prospect (x3? x4?)
  • sales (x?)
  • product (x?)
  • request (x?)
  • forecast (x?)
  • etc. …

As an application grows, the number of pages grows to a list of 100+ URLs in no time.

Logic says that just copy/pasting these URLs in where needed on a page is ugly and a pain to maintain, but loading up 100+ key/values seems redundant if you only need 2 or 3 of them on “this” page.

Technically this is a language-agnostic (ASP,JSP,PHP,RoR,Python,etc.) question but I intend to implement in PHP (in an MVC setup). However if ASP.Net or Rails has a “really cool” way of doing this I’m all ears.

Update:

I’m mid-way through converting a non-MVC PHP app to use an MVC structure. Previously I had a big set of key’d links that were the base URL for a page, e.g.:

$URLs['CUSTOMER_ORDER_CONTACTS'] = '/customerordercontacts.php';
$URLs['CUSTOMER_PRODUCTS_EDIT'] = '/editcustomerproducts.php';
//etc.

Since I might be linking to the “Customer Products Edit” screen from anywhere, each page loaded this list, so that if/when the URL changed to another page… changing the item in the list would update all links.

However as I read the answers here I think I might have answered my own question by accident. What @Blixt wrote is pretty much the structure I have/plan to follow… at which point the URL is really structured in such a way that I don’t need to have this list at all:

Example: If I am rendering a customer… and want to provide a link to each contact

//pseudo code
$contacts = $customer.getContacts();

//previous rendering list of links
foreach($contacts as $key => $value){
  echo('<a href="'.$URLs['CUSTOMER_CONTACT_VIEW'].'?customer='.$custID.'&contact='.$key.'">'.$value.'</a>');
}

//new rendering list of links
foreach($contacts as $key => $value){
  echo('<a href="/customer/'.$custID.'/contact/'.$key.'">'.$value.'</a>');
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T08:04:00+00:00Added an answer on May 12, 2026 at 8:04 am

    I like to keep the URLs as logical as possible, and avoid framework-specific URLs (consider that you may change the framework in the future, which would then have to keep using your old URL patterns to avoid breaking external links.)

    Basically:

    # All customers:
    /customers/
    # New customer:
    /customers/new
    /customers/?new # another version if you don't think "new" deserves its own path
    # Existing customer:
    /customers/123/
    /customers/123 # another version if you want the concept that it's a page, not a
                   # directory
    # Edit customer:
    /customers/123/edit
    /customers/123?edit
    
    # Some sub-list for a customer:
    /customers/123/orders/
    
    # and so on...
    

    To be honest, I personally prefer the second example in the cases where I provided two examples. It uses the concept from file systems that lists are “directories” and separate entries are “files”. Every path represents some kind of data, and other paths are separated using the query string (/customers/?new).

    After you’ve decided on your URL structures, you should have a look at how to implement this in your web framework. Most frameworks I consider “good” have some kind of support for mapping URLs (usually with some kind of pattern supporting wildcards, such as regular expressions.) So your patterns might look like this, using my second examples (regex):

    ^/customers/$ -> CustomerList
    ^/customers/(\d+)$ -> Customer # This will check the query string for "edit" etc
                                   # to determine which mode to use.
    ^/customers/(\d+)/orders/$ -> OrderList
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.