Quote:
Originally Posted by tosbourn
Maybe he means instead of having something like.
article.php?a=12345
having
/article/Article_title.html
There are ways of doing this (blogs and message boards have mods to allow this) but it would be a fairly large undertaking.
|
once you get the hang of it, it is really rather easy.
if your running an Apache server you will need mod_rewrite installed and configured.
after that you just edit your .htaccess file to contain something like this
Code:
1: RewriteEngine on
2: RewriteRule ^article/([^/\.]+)/?$ viewarticle.php?id=$1 [L]
3: RewriteRule ^section/([0-9]+)/?$ viewsection.php?id=$1 [L]
4: RewriteRule ^section/([a-z]+)/?$ viewsection.php?id=$1 [L]
Line one tells the site to use mod_rewrite
Line two tells the serv that if it gets something like www.yoursite.com/article/42 that its the same thing as if you typed www.yoursite.com/viewarticle.php?id=42
line two accepts just about everything
line three will only accept a string of numbers
and line four will only accept a string of letters
keep in mind that the [L] must be at the end of each line
do a google search for mod_rewrite it will go into much more depth and explain how to write the rewrite rules in much greater detail
|