473,608 Members | 1,811 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Wanted: PHP Site Map Generator!

Hi,

Having spent my free time over the last few months converting several
hundred pages of mainly static (s)html into eight pages of data driven php
loveliness and a whopping MySQL database I'm faced with a bit of a dilemma.

Will search engines be able to crawl all the index.php?query paths so
people can find stuff? I'm currently at the top of the heap on Google as my
site has been around for years and is pretty niche and I don't want to lose
that advantage.

Which leads to the main part of the question; is there a 'site map'
generator which will vreate a single crawlable HTM page with all my
possible pages on iot which I can then link to from my home page which will
enable the search spiders to do their thing?

Or am I left with the unenviable task of having to put response/redirects
on all the old pages pointing to the equivalent dynamic pages?

Many thanks,

Mik Foggin
--
Remove capitals to reply :)
Jul 17 '05 #1
5 3025
Mik Foggin wrote:
Having spent my free time over the last few months converting several
hundred pages of mainly static (s)html into eight pages of data driven php
loveliness and a whopping MySQL database I'm faced with a bit of a dilemma.

Will search engines be able to crawl all the index.php?query paths so
people can find stuff? I'm currently at the top of the heap on Google as my
site has been around for years and is pretty niche and I don't want to lose
that advantage.
Well, you don't actually have to change the URIs of the pages on your
site. In fact, doing so may get you into a bit larger problem since all
your inbound links and such will no longer be valid.

You can use apache's mod_rewrite (or isapi_rewrite for IIS) to make your
changes transparent to the client. For instance, say you have products
that were once accessed via the following:

/products/prodnum1.shtml
/products/prodnum2.shtml
/products/prodnum3.shtml

The way it sounds like you have it now is more like:

/products.php?pr odnum=prodnum1
/products.php?pr odnum=prodnum2
/products.php?pr odnum=prodnum3

If you used mod_rewrite, you can take care of that by putting the
following in a .htaccess file:

RewriteEngine On
RewritePath /
RewriteRule ^products/([a-zA-Z0-9_-])+\.shtml$ prod.php?prodnu m=$1 [L]

The uri /products/number.shtml will then tranlate to the page
prod.php?prodnu m=number

*NOTE:* the target php file name should not be the same as part of the
URI you want to translate. Dependind on the order that the modules are
loaded, this may not give you the results you expect.

Added bonus: no need to have webmasters of other sites fix links. No
need to worry about search engines finding the new content. No need to
worry about loosing points with Google's PR.

Just remember, sites that have URIs that don't change over time will
have a better chance at keeping higher rankings in the search engines.
Which leads to the main part of the question; is there a 'site map'
generator which will vreate a single crawlable HTM page with all my
possible pages on iot which I can then link to from my home page which will
enable the search spiders to do their thing?
http://home.snafu.de/tilman/xenulink.html is a good piece of software...
very handy!
Or am I left with the unenviable task of having to put response/redirects
on all the old pages pointing to the equivalent dynamic pages?


You should do this anyway, but use mod_rewrite or equivalent if you had
a strong structure to begin with. Creating new files to handle each one
of these is a pain in the arse.

There also used to be a place on the php website where you could
download their url search code. The concept was simple. Say you enter in
a URI that doesn't exist on the site..

http://www.php.net/preg_replace

you are automatically redirected to:

http://www.php.net/manual/en/function.preg-replace.php

I'm sure someone here still has the code or the url to get it from... ;)

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.

Jul 17 '05 #2
> Mik Foggin wrote:
Having spent my free time over the last few months converting several
hundred pages of mainly static (s)html into eight pages of data driven php loveliness and a whopping MySQL database I'm faced with a bit of a dilemma.
Will search engines be able to crawl all the index.php?query paths so
people can find stuff? I'm currently at the top of the heap on Google as my site has been around for years and is pretty niche and I don't want to lose that advantage.


Well, you don't actually have to change the URIs of the pages on your
site. In fact, doing so may get you into a bit larger problem since all
your inbound links and such will no longer be valid.

You can use apache's mod_rewrite (or isapi_rewrite for IIS) to make your
changes transparent to the client. For instance, say you have products
that were once accessed via the following:

/products/prodnum1.shtml
/products/prodnum2.shtml
/products/prodnum3.shtml

The way it sounds like you have it now is more like:

/products.php?pr odnum=prodnum1
/products.php?pr odnum=prodnum2
/products.php?pr odnum=prodnum3

If you used mod_rewrite, you can take care of that by putting the
following in a .htaccess file:

RewriteEngine On
RewritePath /
RewriteRule ^products/([a-zA-Z0-9_-])+\.shtml$ prod.php?prodnu m=$1 [L]

The uri /products/number.shtml will then tranlate to the page
prod.php?prodnu m=number

[snip]

This is exactly what I did (or rather, had to do) when converting our
well-indexed site from static to dynamic. Can't say it was the most fun I
ever had, but it was worth it.

http://www.devarticles.com/art/1/506 gives a nice intro to mod_rewrite if
you're on Apache. Also note if you find the page is coming up fine but your
images and links are broken, the <base href> tag is your friend.
Jul 17 '05 #3
Justin Koivisto <sp**@koivi.com > wrote in
news:Kg******** *********@news7 .onvoy.net:


You can use apache's mod_rewrite (or isapi_rewrite for IIS) to make
your changes transparent to the client. For instance, say you have
products that were once accessed via the following:

/products/prodnum1.shtml
/products/prodnum2.shtml
/products/prodnum3.shtml

The way it sounds like you have it now is more like:

/products.php?pr odnum=prodnum1
/products.php?pr odnum=prodnum2
/products.php?pr odnum=prodnum3

If you used mod_rewrite, you can take care of that by putting the
following in a .htaccess file:

RewriteEngine On
RewritePath /
RewriteRule ^products/([a-zA-Z0-9_-])+\.shtml$ prod.php?prodnu m=$1 [L]

The uri /products/number.shtml will then tranlate to the page
prod.php?prodnu m=number


Thanks for the response, unfortunately the original structure wasn't as
well defined as your suggestion may require; I have 7 sub directories but
there is no simple structure to the file names, so rather than as in your
example above its more like:

/products/apples.shtml
/products/cheese.shtml
/products/cornedbeef.shtm l

need mapping to /products/index.php?prodn um=x

so I expect I can't write a simple rule but will have to set a rewrite
for each file. Labourious but undoubtedly worth it!

I'm checking with my web hosts to see whether or not I can actually use
the mod_rewrite function at all so we'll see how we go!

Mik.

--
Remove capitals to reply :)
Jul 17 '05 #4
sk
Sounds like it might be too late now, but if you'd planned ahead you
could have imported into your database both the page content itself and
its old URI (that is, the directory name and filename) as a separate
field. Then you could do a one-time query from your database to
generate a list of static redirects that you could paste into your
httpd.conf, e.g.:

/food/cabbage.html /article.php?id= 3
/drink/hot/tea.htm /article.php?id= 4
....

That's what I did years ago in the days before fancy geegaws like
mod_rewrite.

--
Steve Koppelman

Mik Foggin wrote:
Justin Koivisto <sp**@koivi.com > wrote in
news:Kg******** *********@news7 .onvoy.net:
You can use apache's mod_rewrite (or isapi_rewrite for IIS) to make
your changes transparent to the client. For instance, say you have
products that were once accessed via the following:

/products/prodnum1.shtml
/products/prodnum2.shtml
/products/prodnum3.shtml

The way it sounds like you have it now is more like:

/products.php?pr odnum=prodnum1
/products.php?pr odnum=prodnum2
/products.php?pr odnum=prodnum3

If you used mod_rewrite, you can take care of that by putting the
following in a .htaccess file:

RewriteEngi ne On
RewritePath /
RewriteRule ^products/([a-zA-Z0-9_-])+\.shtml$ prod.php?prodnu m=$1 [L]

The uri /products/number.shtml will then tranlate to the page
prod.php?prod num=number

Thanks for the response, unfortunately the original structure wasn't as
well defined as your suggestion may require; I have 7 sub directories but
there is no simple structure to the file names, so rather than as in your
example above its more like:

/products/apples.shtml
/products/cheese.shtml
/products/cornedbeef.shtm l

need mapping to /products/index.php?prodn um=x

so I expect I can't write a simple rule but will have to set a rewrite
for each file. Labourious but undoubtedly worth it!

I'm checking with my web hosts to see whether or not I can actually use
the mod_rewrite function at all so we'll see how we go!

Mik.


Jul 17 '05 #5
sk <st***********@ hatless-dot-com-without-the-spam.com> wrote in
news:Kgsdb.6063 68$o%2.285348@s ccrnsc02:
Sounds like it might be too late now, but if you'd planned ahead you
could have imported into your database both the page content itself
and its old URI (that is, the directory name and filename) as a
separate field. Then you could do a one-time query from your database
to generate a list of static redirects that you could paste into your
httpd.conf, e.g.:

/food/cabbage.html /article.php?id= 3
/drink/hot/tea.htm /article.php?id= 4
...

That's what I did years ago in the days before fancy geegaws like
mod_rewrite.

--
Steve Koppelman


Seems like mod_rewrite is a no-go so the httpd.conf could be a real life
saver,

Many thanks,

Mik
Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2962
by: Florent | last post by:
Hi, I run a few sites and I want to log in my main site database when/if there is a problem, (like a page not found or an unknown agent). But I don't want to give direct access to my database to the other sites, so how could I safely pass data, (without passwords), from one site to another? Thanks. Simon
9
2678
by: Francis Avila | last post by:
A little annoyed one day that I couldn't use the statefulness of generators as "resumable functions", I came across Hettinger's PEP 288 (http://www.python.org/peps/pep-0288.html, still listed as open, even though it's at least a year old and Guido doesn't seem very hot on the idea). I'm not too sure of its ideas on raising exceptions in generators from outside (although it looks like it might be convenient in some cases), but being able...
17
2422
by: Andrae Muys | last post by:
Found myself needing serialised access to a shared generator from multiple threads. Came up with the following def serialise(gen): lock = threading.Lock() while 1: lock.acquire() try: next = gen.next() finally:
1
1464
by: ted | last post by:
Looking for advice on the best approach to building static websites. Last year I built a static website with XSLT. The content is in XML and I run it through XSLT to update the site. The XSLT builds about 200 pages. Each page keeps a "bread-crumb" of links so the user can navigate back and forth. The pages also indicate which "section" it is in. The XSLT also builds the "print version" of the page. I have a main template (basically a...
6
6212
by: Dan V. | last post by:
I am using: http://www.csscreator.com/version2/pagelayout.php and choose HTML 4.01 transitional as I think this means it will be supported by more browsers. However in Macromedia Dreamweaver 2004 MX it tells me that 'min-width' is not supported in IE 5.0-6. Is this true? Does anyone have or know a better css layout generator, that works great across browsers and looks good in the Macromedia Dreamweaver 2004 MX designer so 'what I see...
0
1354
by: Wim Hoogenraad | last post by:
Dear Webprofessional, In this newsletter we like to inform you about some developments on our website. First of all we would like to thank you who joined WebmastersLookup. Without the Usenet community the service would not have grown so fast. The membership is still open and it's for free. In the past few weeks we've been
3
1108
by: D. Shane Fowlkes | last post by:
(still a .NET newbie) I have a chunk of code in a Page_Load routine that pulls data from a SQL Server table. The Select statement looks for any "events" scheduled for today. Then my IF statement writes some HTML to a asp:label tag and conditionally fills it with HTML based upon any records were found. Seems simple huh? It works fine if the recordset is null...or in .NET speak, if the If Not DataReader.Read()..but when data IS...
5
2270
by: | last post by:
Trying to learn about manipulating collections of objects, and populating these objects dynamically from datasources. Could someone post a code sample that shows the following: Instantiating a collection object -- say, a dictionary. Populating that collection object with custom objects, say, Person. What I really want to see is how to populate the properties of those Person objects from a datasource: instantiate one Person, fill...
0
1567
by: HackingPSP | last post by:
I saw a lot of requests for a program like this, so I wrote it. Yeah, my site has "PSP software by Auri" but in this case it means "Pretty Sweet Programming" :) There's both a VS2005 add-in and a standalone app (separate downloads, you don't need both). This is my second developer utility this year - my first being the Lorem Ipsum generator from a few weeks back. Download and get more info on WebPrecompiler at...
0
8069
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8503
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8488
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8358
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6826
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6017
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4036
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1339
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.