You are here: static URLs « HTML « IT news, forums, messages
static URLs

Posted by Jonathan N. Little on 04/02/06 16:31

Okay I have been futzing with this for a bit, so a request other viewpoints.

Using a website database and you want to present with static URLs so a
call to:

http://www.example.com/frontend.php?id=2

Becomes:

http://www.example.com/page/2

With .htaccess:
RewriteRule ^page/([\d]*) frontend?id=$1 [L]

Ok, that takes care of static link in a webpage, but what if you want to
get a page as a result of some form query and still want the result to
appear as a static URL? Say a page selector form a could go to a
intermediate parsing script like:

<form action="http://www.example.com/q2url.php">
<select name="id">
<option value="25">Some page</option>
....

Where q2url.php is:

$id = $_GET['pageID'];
$redirect = "http://www.example.com/page/$id";
header("Location: $redirect");

So the result will appear again as a static:
http://www.example.com/page/25

Or is there another way to do this with a rewrite rule. If so any
advantages/disadvantages?



--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация