 |
 |
Two colons, one URL.
|
 |
|
 |
|
Junior Member
Join Date: May 2003
Status:
Offline
|
|
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
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Oct 2000
Status:
Offline
|
|
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
|
|
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
|
|
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...
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|