[ka-Map-users] RE: Multiple URLs - one ka-map install - variablepassing question?

David William Bitner bitner at gyttja.org
Wed Jul 12 20:52:56 EDT 2006


AFAIK, A web crawler only follows links.  As such, it doesn't care whether
something is a directory, an actual file, or something that _looks_ like a
file.  I believe that most crawlers will ignore things after a ? and so
normal cgi, php, etc. links don't get indexed.

I have never used mod_rewrite with maps, but I use it for just about all the
content on http://www.macnoise.com.  As you can see (
http://www.google.com/search?q=+site:www.macnoise.com+macnoise) all the
links which are actually generated by php get crawled. For example:
www.macnoise.com/maps actually pulls up
www.macnoise.com/index2.php?page=maps.

Hope this helps.  I'd be curious to hear if you use this approach and if it
works for you.  I think that it's really cool how you  just use different
'directories' as spatial bookmarks.

David

On 7/12/06, Steve Walker <walker at mfgis.com> wrote:
>
> David,
>
> Thank you for the response.
>
> mod_rewrite does sound very powerful and I will look into it.
>
> Having not yet done so, will you forgive me the following follow-up
> questions-
>
> As I understand you, the web-visible URL need not exist as a pysical page,
> it could just as easily be a value ('California')  associated with a
> record in a database grabbed via a cgi script as massaged by mod_rewrite.
>
> However, I may wish for the page to actually physically exist (i.e. so web
> crawlers can find it).
>
> In which case, how does one proceed?  Could empty system directories
> and/or files serve the purpose:
>
> /var/www/htdocs/Washington
> /var/www/htdocs/California
> /var/www/htdocs/California/Los_Angeles
> /var/www/htdocs/California/Los_Angeles/Hollywood.html
> /var/www/htdocs/California/Los_Angeles/East_LA.html
>
> Such that a web crawler would find a physical page for Los_Angeles but
> mod_rewrite would re-write the URL into a SQL query for use by a cgi-bin
> script to have my database provide the content?
>
> If that's what you're telling me then Sign Me Up!
>
>
> Thanks again,
>
> -steve
>
>
>
>
> > Steve --
> >
> > You really should take a look at mod_rewrite, I think that it would
> really
> > be quite easy to do what you are trying to accomplish.
> >
> > The basic idea is that you would setup a rule in apache that would take
> > any
> > url of the form http://www.usmapserver.com/california and you would
> > internally (the end user will never see what you are doing) change that
> > url
> > to http://www.usmapserver.com/index.html?state=california.  Then you
> would
> > just need to have a lookup in index.html that would find the bbox for ca
> > and
> > would zoom in there.
> >
> > It's actually pretty darn slick when you get it running.
> >
> > David
> >
> > On 7/12/06, Steve Walker <walker at mfgis.com> wrote:
> >>
> >>
> >> I have partially solved my own question posted below.
> >>
> >> I have discovered the following:
> >>
> >> To view multiple pages such as
> >> http://www.blahblah.com/location1 and
> >> http://www.blahblah.com/location2
> >>
> >> from the same ka-map back-end, do the following:
> >>
> >> Modify the init.php, changing file 'includes' as necessary to point to
> >> the
> >> correct locations on the file system (ie tile.php, config.php) as you
> >> will
> >> copy the init.php file to multiple locations on the file system and the
> >> relative pointers to these files may/will break.
> >>
> >> Also in init.php, insert the line
> >> include_once('./variables.php');
> >> before the include_once( 'config.php) entry.  This pulls in the
> >> variables
> >> (extent, map name, title) as noted in my original posting.
> >>
> >> modify the *.js files again to replace path names as necessary, for the
> >> same reason as above (ie from 'images/blahblah.jpg' to
> >> '/ka-map/images/blahblah.jpg'
> >>
> >> copy both the init.php files to the corresponding location(s) on the
> >> file
> >> system.
> >>
> >> re-write the index.html files (using scripts & templates) to reflect
> the
> >> page-specific values from variables.php such as name, title, etc.
> >>
> >> /var/www/htdocs/location1/init.php
> >> /var/www/htdocs/location1/index.html
> >> /var/www/htdocs/location1/variables.php
> >>
> >> /var/www/htdocs/location2/init.php
> >> /var/www/htdocs/location2/index.html
> >> /var/www/htdocs/location2/variables.php
> >>
> >> This solution works as you can see for example from
> >>
> >> www.usmapserver.com/Washington
> >> www.usmapserver.com/California
> >> www.usmapserver.com/California/Los_Angeles
> >>
> >> However, drawbacks include:
> >>
> >> 1.  need to make a copy of init.php for each desired web page rather
> >> than
> >> pointing to a single master.
> >> 2.  need to (progromatically) re-write each index.html (ie to generate
> >> title, name, links) from scratch rather than including these values at
> >> run-time.
> >>
> >> I am still scratching at the surface of understanding and will report
> >> anything else I learn.
> >>
> >> -steve walker
> >>
> >> > Hello,
> >> >
> >> > I am hoping to be able to achieve the following:
> >> >
> >> > Have
> >> > http://www.usmapserver.com/location1
> >> > http://www.usmapserver.com/location2
> >> > (and n  additional URLS)
> >> >
> >> > each launch the same ka-map application (same map, data, etc)
> >> > but so that each grabs its extent and title (among other things) from
> >> > the URL's  index.php file as here:
> >> >
> >> > /var/www/htdocs/location1/index.php:
> >> >     $title = 'Map of Green City';
> >> >     $extent = '-120,40,-115,45';
> >> >     $include ("/var/www/htdocs/kamap_index.html");
> >> >
> >> > /var/www/htdocs/location2/index.php:
> >> >     $title =  'Map of Red Town';
> >> >     $extent = '-90,30,-70,40';
> >> >     $include ("/var/www/htdocs/kamap_index.html");
> >> >
> >> > where of course location1/index.php corresponds with
> >> > http:/www.usmapserver.com/location1   etc.
> >> > and where kamap_index.html is essentially the ka-map distribution
> >> html.
> >> >
> >> > My idea is to replace (in init.php) the extents read from the map
> file
> >> > $szExtents = $oMap->extent->minx.",".$oMap->extent->miny.",".
> >> >     $oMap->extent->maxx.",".$oMap->extent->maxy;
> >> >
> >> > with
> >> >
> >> > $szExtents = $extent;
> >> >
> >> > where $extent is the $extent variable in index.php
> >> >
> >> > (CF The analogous setup using the chameleon environment at
> >> usmaperver.com
> >> > - a web page for each state, county, and city in the nation.)
> >> >
> >> >
> >> > The problem, as I understand it, is that these variables don't get
> >> passed
> >> > through.  And here is where my skills break down - specifically on
> the
> >> the
> >> > javascript side.
> >> >
> >> > I can *fake it* but only for one page:  In init.php, near the line
> >> > include_once( '/var/www/htdocs/include/config.php' );
> >> >
> >> > I can add
> >> > include_once( '/var/www/htdocs/location1/variables.php' );
> >> >
> >> > But this will only work if hard-wired to the
> 'location1/variables.php'
> >> > and since I don't know how to move these variables through, I can't
> >> write
> >> >
> >> > $variable_path = '/var/www/htdocs/' . $url_base . '/variables.php';
> >> > include_once( $variable_path );
> >> >
> >> > where $url_base would be one of location1,location2,...,locationN
> >> >
> >> >
> >> > Does this make sense?  Clearly I wouldn't even need to bother with
> >> this
> >> > kluggy 'include_once' in init.php if those variables originally
> >> defined
> >> in
> >> > index.php were passed through.
> >> >
> >> > I think I am missing something simple (php globals?  javascript
> >> anything?)
> >> >
> >> >
> >> > Thanks for any insights.
> >> >
> >> >
> >> >
> >> >
> >> > --
> >> > Steve Walker
> >> > Middle Fork Geographic Information Services
> >> > walker at mfgis.com
> >> > 360-671-2505
> >> >
> >> > _______________________________________________
> >> > ka-Map-users mailing list
> >> > ka-Map-users at lists.maptools.org
> >> > http://lists.maptools.org/mailman/listinfo/ka-map-users
> >> >
> >>
> >>
> >> --
> >> Steve Walker
> >> Middle Fork Geographic Information Services
> >> walker at mfgis.com
> >> 360-671-2505
> >>
> >> _______________________________________________
> >> ka-Map-users mailing list
> >> ka-Map-users at lists.maptools.org
> >> http://lists.maptools.org/mailman/listinfo/ka-map-users
> >>
> >
> >
> >
> > --
> > ************************************
> > David William Bitner
> > bitner at gyttja.org
> >
>
>
> --
> Steve Walker
> Middle Fork Geographic Information Services
> walker at mfgis.com
> 360-671-2505
>
>


-- 
************************************
David William Bitner
bitner at gyttja.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ka-map-users/attachments/20060712/3cfc09ab/attachment-0001.html


More information about the ka-Map-users mailing list