Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

what to use create, .html or .cgi

by andrew (Acolyte)
on Sep 27, 2002 at 15:16 UTC ( [id://201225]=perlquestion: print w/replies, xml ) Need Help??

andrew has asked for the wisdom of the Perl Monks concerning the following question:

Im starting a new site that is like a hotscripts, Now hotscripts use .htm files for all there pages. But see I dont wanna do that I wanna do something like

http://webewebin.com/?source=13
instead of..
http://webewebin.com/Programs_and_Scripts/Perl/Advertisements/index_02.html

... But if everyone one of my CGI pages I add meta tags in there would they show up on search engines??? or does it have to be HTML.

Replies are listed 'Best First'.
Re: what to use create, .html or .cgi
by Zaxo (Archbishop) on Sep 27, 2002 at 15:28 UTC

    As I understand it, search engines try to avoid indexing dynamic content. It's apt to not be the same on retrieval. They can't tell, though, if the URL for access is disguised through any of the server's aliasing or rewriting techniques. That done, it's all html to them.

    After Compline,
    Zaxo

      We use url rewritting technic expressly to get search engines to not reject the sites we build. Once that is done then the whole issue of search engine rank comes into play and thats a separate discussion.
Re: what to use create, .html or .cgi
by seattlejohn (Deacon) on Sep 27, 2002 at 18:29 UTC
    If necessary, you can pass parameters to a CGI script so that the URL looks "normal". For example: http://www.mysite.com/myscript/param/and/more/params where myscript is your script and everything following it is a sequence of parameters.

    The trick is that everything beyond the script name gets stored in an environment variable called PATH_INFO. So you could then do something like this: my ($this, $that, $the, $other) = split '/',$ENV{PATH_INFO}; Just because it looks like a normal path to the user (and presumably to search engines) doesn't mean your code has to interpret it as such.

    I should mention that, while I know this technique works on Apache, I'm not certain it's a universal capability.

      I honestly dont get wut u mean here how is myscript a script its a folder????
        Think of the URL less literally as a directory path, and more as a string that gets passed to the Web server to tell it where to look for a file to serve.

        Let's say you have a server whose docroot is at ~myname/httpd. This server is visible at the URL http://www.mysite.com.

        Now any file you put into ~myname/httpd, say ~myname/httpd/contact_me.html, is available through the Web server -- in this case as http://www.mysite.com/contact_me.html.

        That file doesn't have to be an HTML document; it could also be a script. Save a simple CGI script in the docroot as test.pl and you can now run it by visiting http://www.mysite.com/test.pl. (Maybe; see footnote below.)

        You can append even more information to the URL, like http://www.mysite.com/test.pl/12345, and this will still run test.pl with 12345 in $ENV{PATH_INFO}.

        Is any of this really necessary for your particular application? I don't really have enough information to say. But it is an alternative to the question-mark way of passing CGI params.

        Footnote: Depending on your server configuration, you might not actually be able to execute arbitrarily-named programs from arbitrary directories. So you might actually have to do something like http://www.mysite.com/cgi-bin/myprog.cgi/more/params/go/here.

Re: what to use create, .html or .cgi
by andrew (Acolyte) on Sep 27, 2002 at 15:28 UTC
    actuall, I wanted too do this

    http://webewebin.com/?source=/Programs_and_Scripts/Perl/Advertisements/

    ..but I couldnt do that if I had c++ cause of the pluses will mess it up

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://201225]
Approved by krujos
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (7)
As of 2024-04-19 07:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found