Forum Moderators: phranque

Message Too Old, No Replies

I need some help with static pages.

         

Dpeper

5:16 am on Jun 3, 2004 (gmt 0)

10+ Year Member



I have results for widgets on my site.
Currently when you search for widgets by state for say it all comes back to one page "browse.php"

I want to create pages, that, Are static result pages such as "arizona.php" etc... that display the widget listings for that state, Is there any way to make these? With content that updates along with the database, or do I have to manually update it?

If you need any thing clarified just ask.

Donny

This is what I got so far...

this will involve making a file named .htaccess that contains the rules
example:
if the user types in site.com/arizona.php send them to site.com/browse.php?state=arizona
if the user types in site.com/colorado.php send them to site.com/browse.php?state=colorado

RewriteEngine on
RewriteRule %{REQUEST_URI}!^browse.php
RewriteRule (.*).php browse.php?state=$1

Thanks whosawhata

Dpeper

7:04 am on Jun 4, 2004 (gmt 0)

10+ Year Member



No luck on this one ehh?

jdMorgan

4:13 pm on Jun 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Donny,

The question is not clear. Do you want to actually create static pages, or do you want to map static-type URLs to dynamically-created pages?

There are many examples of the latter approach posted in this forum, if that's what you're looking for.

Jim

Dpeper

11:47 pm on Jun 6, 2004 (gmt 0)

10+ Year Member



Basically when people search for widgets on my site they get a list of listings in a certain area. I want to make those result pages static, For city, and state.

I want pages that a search engine will index, so I can somewhat captalize on having a bigger site in the search engine. Hope that clarifys it if not I can answer and other questions.

jdMorgan

2:01 am on Jun 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is a mostly problem of semantics: "Static page" usually means a page hand-written using an HTML editor or WYSIWYG editor, and not generated by a server-side script.

An alternative definition is a "static" copy of a dynamically-generated page that is used to avoid having to run the script that generates the page too often. The usual method is to serve the static page if it is time-stamped after the last-modified date of the database that drives the script. If the database has been updated since the last time the static page was updated, then the script is re-run to create a new static page using the updated database.

A completely-different approach is to use a script to generate your pages, but to have the script generate on-page links to URLs that appear to be static pages, e.g. www.mysite.com/products/widgets/blue/large/model3.html. Apache mod_rewrite can then be used to convert those pages' URLs, when requested by clients (browser & spiders), to the dynamic-type URLs needed to call the script again, e.g. www.mysite.com/catalog.php?section=products&line=widgets&color=blue&size=large&model=3

Given all the possible things you might mean by "static pages," it's impossible to answer your question without further information on what you want to achieve.

Jim

Dpeper

2:51 am on Jun 8, 2004 (gmt 0)

10+ Year Member



By static page i mean a page I can set up and not really ever have to look at again. But when new widgets are listed I want them to be on that static page. A Static Page with information that updates automatically With changes in the data base?