URL access

1

1995 Cobra

Hey all, not sure if this is a stupid question or not, but here goes.
If someone were to type this into there URL bar:

http://www.nameofmysite.com/something

They would get an error as there is no directory called "something."
Is there though a way to utilize that to work w/out creating a
directory called "something?" For instance, if they typed that in they
would be directed to a page that used "something" as though it were a
querystring (without typing the "?")?

thanks.
 
J

Jukka K. Korpela

Scripsit 1995 Cobra:
Hey all, not sure if this is a stupid question or not,

There are no stupid questions, just...
If someone were to type this into there URL bar:

http://www.nameofmysite.com/something

They would get an error as there is no directory called "something."

No, because host www.nameofmysite.com does not exist. Use the .example
convention if you must avoid using real URLs.
Is there though a way to utilize that to work w/out creating a
directory called "something?"

Of course. A URL need not correspond to any directory or any file.
For instance, if they typed that in they
would be directed to a page that used "something" as though it were a
querystring (without typing the "?")?

You haven't decided what you really want to do, have you? Or you just
don't want to reveal it to us. Too bad, because this _sounds_ like a
feeble attempt at creating some phishing.
 
1

1995 Cobra

Scripsit 1995 Cobra:


There are no stupid questions, just...


No, because hostwww.nameofmysite.comdoes not exist. Use the .example
convention if you must avoid using real URLs.


Of course. A URL need not correspond to any directory or any file.


You haven't decided what you really want to do, have you? Or you just
don't want to reveal it to us. Too bad, because this _sounds_ like a
feeble attempt at creating some phishing.

Nevermind. I love it when someone looks for a little help and they get
responses like these two instead. Have a nice day.
 
J

Jonathan N. Little

1995 said:
Hey all, not sure if this is a stupid question or not, but here goes.
If someone were to type this into there URL bar:

http://www.nameofmysite.com/something

Well as you should be aware of now, don't use a possible REAL url, but

www.example.com/something
They would get an error as there is no directory called "something."
Is there though a way to utilize that to work w/out creating a
directory called "something?" For instance, if they typed that in they
would be directed to a page that used "something" as though it were a
querystring (without typing the "?")?


and I thing the answer is yes, you can make

www.example.com/something

equal to

www.example.com/someScript.cgi?something.

Often done with mod_rewrite and .htaccess files on Apache servers to
present human and search engine friendly URLs for database driven sites

www.example.com/articles/2005/06/01/foo

equal to

www.example.com/findArticleScript.cgi?year=2005&month=06&day=01&topic=foo
 
R

richard

Hey all, not sure if this is a stupid question or not, but here goes.
If someone were to type this into there URL bar:

http://www.nameofmysite.com/something

They would get an error as there is no directory called "something."
Is there though a way to utilize that to work w/out creating a
directory called "something?" For instance, if they typed that in they
would be directed to a page that used "something" as though it were a
querystring (without typing the "?")?

thanks.


Learn about "redirect".
There are ways so that if a dreaded "404" error occurred, you could
send the user to a certain page that does exist.
 
D

David Segall

1995 Cobra said:
Hey all, not sure if this is a stupid question or not, but here goes.
If someone were to type this into there URL bar:

http://www.nameofmysite.com/something

They would get an error as there is no directory called "something."
Is there though a way to utilize that to work w/out creating a
directory called "something?" For instance, if they typed that in they
would be directed to a page that used "something" as though it were a
querystring (without typing the "?")?
There is, but it requires processing on the server. Servers provide a
way of directing an error, in this case 404, to a page you choose.
That page can contain code in a your favourite web processing language
such as PHP, Perl or Java to interpret the URL and return HTML code to
the user. TinyURL <http://www.tinyurl.com> uses this technique to
transform a "tiny URL" into the real URL that it has stored in its
database.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,102
Messages
2,570,645
Members
47,243
Latest member
CorrineCad

Latest Threads

Top