Go Back   Ascended Development forum > Forum > Programming

Programming Programming-related topics

Reply
 
Thread Tools Display Modes
  #1  
Old 11-03-2009, 09:56
novelt novelt is offline
Member
 
Join Date: Mar 2009
Posts: 1
Default Does It Matter Which URL I Use?

Which form of URL should you use? The one with the directory name alone, or the one with the filename? There are a few ways to look at this.

Some people argue that using the directory name alone (like www.example.com/about/) is superior to using the actual filename. When you use the directory name, the Web Site Design web server will transparently find the index file and deliver it to the user (or search engine). In theory, this means that if you ever want to change to use a different filename for your index page, such as if you want to use a script like index.php to display the page instead of a static page like index.html, you can easily do that without changing any of the URLs on your site. All you have to do is to modify your server configuration file accordingly.

In practice, however, the above advantage is not significant. If you currently directly refer to index.html and later want to use a script file named index.php to generate the content, it's also possible to modify your server configuration file so that the web server invokes index.php when the index.html file is requested. The technique for this is given in my article How to Masquerade Your CGI/PHP Scripts as Static HTML Pages and it involves no more work than that required to deliver index.php for a directory name.

If you have a brand new site that has not been indexed yet, and cannot decide which method to use, use the directory name form (like example.com/about/). I personally think it is marginally better because the URL is shorter. Short URLs have some advantages: besides being easier to remember, they also avoid some of the mangling that hits long URLs by third party sites and forum software, as mentioned in my article How to Create Good Filenames for Your Web Pages.

If your site has already been in existence for some time, you should look for the form of URL that is most frequently used, both by your website and by others linking to your site, and use that URL consistently throughout your site. This is the method I adopted on thesitewizard.com. The site had already been in existence for a while, with its subdirectory index pages referred to by name, before I realised I preferred the shorter form. Since there were already many links pointing directly to these folder index pages, changing them will cause more problems than it solves. As a result, I decided to be consistent and stick to the form I had been using in the past.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 17:13.


Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.