Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Two colons, one URL.

Two colons, one URL.
Thread Tools
Junior Member
Join Date: May 2003
Status: Offline
Reply With Quote
Jul 25, 2004, 01:29 PM
 
Hey guys,

I'm building a little website at the moment, that uses a URL structure like this:

http://www.domain.com/dir/section:option

The word behind the second colon defines which php file to include. Will the URL work on all browsers, or just some? Is it a bad idea to do it like this? I used it because it was original and clean.

Suggestions, comments?

Thanks,
Jon Marus
www.jmarus.com - kicks by JM
     
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Jul 25, 2004, 03:35 PM
 
Originally posted by jon31:
Hey guys,

I'm building a little website at the moment, that uses a URL structure like this:

http://www.domain.com/dir/section:option

The word behind the second colon defines which php file to include. Will the URL work on all browsers, or just some? Is it a bad idea to do it like this? I used it because it was original and clean.

Suggestions, comments?

Thanks,
Jon Marus
Although someone more knowledgeable will be able to shed some more light, I don't think it's a good idea. Probably be better to just stick with "?". The two places I know that colons are used are after the protocol (can anyone actually explain the :// ?) and for login+passwords:

login:pass@www.domain.com

At least I believe that's the structure. I also don't know how search engines will deal with parsing/navigation your site. When you go to a page like "http://www.domain.com/blah/file.html" does the browser simply go to www.domain.com using http and pass the "/blah/file.html" to the server where the server software interprets the rest? Obviously I'm showing my ignorance in the matter, so I'd like to see someone more experienced in the matter's take on it.
     
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
Jul 25, 2004, 05:03 PM
 
if you just want cleaner urls, use mod_rewrite to tidy things up. for example, a RewriteRule like this:
Code:
RewriteRule /(test)\.php\?foo=([^&;]*)[&;] bar=([^&;]*) /%1/%2/%3/ [L]
will change http://mydomain/test.php?foo=123&bar=45 into http://mydomain/test/123/45/, which is much nicer, and plays better with the search engines.
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Jul 26, 2004, 04:34 AM
 
Usually a ':' on the servername will indicate a specific port number to perform the HTTP request on (i.e. http://www.servername.com:8080), but since your example uses it in the path it can potentially be used as request data. How reliable that will be will be anyone's guess. I'd steer clear, personally.

As Phil suggested, the '&' seperator is the preferred method for compliant URL writing, but some nifty URL rewriting as suggested will allow you more elegant solutions. It also means you may be tied to an Apache solution, as IIS requires commercial software solutions to allow URL rewriting in the manner suggested.
Computer thez nohhh...
     
   
Thread Tools
Forum Links
Forum 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
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:05 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2