Click to See Complete Forum and Search --> : query strings??


sicknote
10-10-2005, 10:58 AM
query strings?? riite?? ... kk ... im kinda having trouble because like google and hotmail and stuff/webpages/websites like that have query strings like whatever.com/cgi-bin/something?me=grate ... lol ... but when i set a query string like this ... www.whatever.com/cgi-bin/something/index.cgi or pl?me=grate and then because it is the index page it can come up like this ... www.whatever.com/cgi-bin/something/?me=grate ... and if i type in ... www.whatever.com/cgi-bin/something?me=grate (this is what i would ike anyway) ... it redirects me to ... www.whatever.com/cgi-bin/something/?me=grate ... but i dont want that ... i just wanted to know if anyone understands this anyway ... if they could tell me how to do it plz plz plz plz lol

thanks :eek:

Ultimater
10-10-2005, 11:10 AM
So you are saying you want or don't want the "index.pl" part in the querry string? Sounds like .htaccess work to me and a matter of changing the default index file.

sicknote
10-10-2005, 11:13 AM
kk ... please continue ... lol

Ultimater
10-10-2005, 11:23 AM
A link that shows you how to use the .htaccess file. (http://www.hostingmanual.net/other/htfun.shtml)
Upload a file by the name of .htaccess (it's a special file name that reads exactly that -- starting with a period and you aren't allowed to add anything in front of the period as with most extensions) to your cgi-bin folder containing the following:

DirectoryIndex index.pl


Then if you have a file by the name of "index.pl" in your cgi-bin, it will be your index file. Note you don't have to name your file "index.pl" it could have just as easilt have been "business.cgi" etc. Another note: You can have multiple indexes, check the link I gave. Final note: you can only have one .htaccess file per directory but you can have one in each directory.

sicknote
10-10-2005, 11:37 AM
so does this mean i can have a URL that looks something like this ... www.whatever.com/something?me=grate ... lol

Ultimater
10-10-2005, 11:41 AM
Correct, depending on the server. Some servers you are forced to put your PL files in your cgi-bin and others not. Regardless the server, PHP would do it in your root directory on all servers as long as PHP is supported by the server.